Add tests for the new object and fix a bug

Each of the individual query chunks has their own test, in addition to a
test for the full combination of parameters that could influence a
query.

There is also a bugfix for the tag query in here, since I want, as much
as possible, to have passing tests on every commit.
This commit is contained in:
Matt Rogers 2019-04-11 09:53:53 -05:00
parent df091c7ec5
commit fc17a03bc0
No known key found for this signature in database
GPG key ID: 605D017C07EB4316
5 changed files with 154 additions and 2 deletions

View file

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