Merge pull request #2233 from ZeiP/bug/1929_broken_feed_missing_tag

#1929: Fix the actions query breaking when querying actions with a no…
This commit is contained in:
Jyri-Petteri Paloposki 2019-05-22 00:49:42 +03:00 committed by GitHub
commit 5962fe808b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -27,6 +27,7 @@ module Todos
if params[:tag]
tag = Tag.where(:name => params[:tag]).first
return [] if !tag
not_done_todos = not_done_todos.joins(:taggings).where('taggings.tag_id = ?', tag.id)
end

View file

@ -84,6 +84,10 @@ class FeedSmokeTest < ActionDispatch::IntegrationTest
assert_success "/todos.rss?token=#{ users(:admin_user).token }&done=7"
end
def test_all_starred_active_actions_rss
assert_success "/todos.rss?token=#{ users(:admin_user).token }&tag=starred"
end
def test_all_actions_completed_in_last_7_days_txt
assert_success "/todos.txt?token=#{ users(:admin_user).token }&done=7"
end