mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-05 07:21:48 +01:00
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:
parent
df091c7ec5
commit
fc17a03bc0
5 changed files with 154 additions and 2 deletions
10
test/fixtures/projects.yml
vendored
10
test/fixtures/projects.yml
vendored
|
|
@ -56,3 +56,13 @@ attendrailsconf:
|
|||
user_id: 2
|
||||
created_at: <%= today %>
|
||||
updated_at: <%= today %>
|
||||
|
||||
attendgophercon:
|
||||
id: 5
|
||||
name: Attend Gophercon
|
||||
description: 'Because those little gopher drawing are cute'
|
||||
position: 2
|
||||
state: 'active'
|
||||
user_id: 2
|
||||
created_at: <%= today %>
|
||||
updated_at: <%= today %>
|
||||
|
|
|
|||
14
test/fixtures/taggings.yml
vendored
14
test/fixtures/taggings.yml
vendored
|
|
@ -22,4 +22,16 @@ foo2:
|
|||
id: 4
|
||||
tag_id: 1
|
||||
taggable_id: 3 # Buy milk - completed
|
||||
taggable_type: Todo
|
||||
taggable_type: Todo
|
||||
|
||||
bar1:
|
||||
id: 5
|
||||
tag_id: 2
|
||||
taggable_id: 16
|
||||
taggable_type: Todo
|
||||
|
||||
bar2:
|
||||
tag_id: 2
|
||||
taggable_id: 20
|
||||
taggable_type: Todo
|
||||
|
||||
|
|
|
|||
33
test/fixtures/todos.yml
vendored
33
test/fixtures/todos.yml
vendored
|
|
@ -4,10 +4,17 @@
|
|||
# rails does automatically in models or controllers! Convert to utc manually!
|
||||
|
||||
<%
|
||||
def yesterday
|
||||
Time.zone.now.utc.beginning_of_day - 1.day
|
||||
end
|
||||
def today
|
||||
Time.zone.now.utc.beginning_of_day.to_s(:db)
|
||||
end
|
||||
|
||||
def tomorrow
|
||||
(Time.zone.now.utc.beginning_of_day + 1.day).to_s(:db)
|
||||
end
|
||||
|
||||
def next_week
|
||||
1.week.from_now.utc.beginning_of_day.to_s(:db)
|
||||
end
|
||||
|
|
@ -255,3 +262,29 @@ email_broker:
|
|||
description: Ask about better stocks
|
||||
notes: ~
|
||||
state: pending
|
||||
|
||||
package_delivered:
|
||||
id: 20
|
||||
context_id: 11
|
||||
project_id: 5
|
||||
description: Package delivery date
|
||||
notes: ~
|
||||
state: active
|
||||
created_at: <%= two_weeks_ago %>
|
||||
due: <%= today %>
|
||||
completed_at: ~
|
||||
show_from: ~
|
||||
user_id: 2
|
||||
|
||||
assemble_furniture:
|
||||
id: 21
|
||||
context_id: 11
|
||||
project_id: 5
|
||||
description: Put together the furniture we bought
|
||||
notes: ~
|
||||
state: completed
|
||||
created_at: <%= two_weeks_ago %>
|
||||
due: <%= today %>
|
||||
completed_at: <%= yesterday %>
|
||||
show_from: ~
|
||||
user_id: 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue