mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-20 17:20:12 +01:00
fix show_from not being clear when a todo comes from tickler
This commit is contained in:
parent
6e654c5d03
commit
cb46a8461e
3 changed files with 47 additions and 12 deletions
|
|
@ -160,17 +160,23 @@ class TodoTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_activate_also_clears_show_from
|
||||
# setup test case
|
||||
t = @not_completed1
|
||||
t.show_from = 1.week.from_now
|
||||
t.save!
|
||||
assert t.deferred?
|
||||
t.reload
|
||||
dates = [1.week.from_now, 1.week.ago]
|
||||
|
||||
# activate and check show_from
|
||||
t.activate!
|
||||
assert t.active?
|
||||
assert t.show_from.nil?
|
||||
dates.each do |show_from_date|
|
||||
# setup test case
|
||||
t = @not_completed1
|
||||
Timecop.travel(show_from_date - 1.day) do
|
||||
t.show_from = show_from_date
|
||||
t.save!
|
||||
assert t.deferred?
|
||||
t.reload
|
||||
end
|
||||
|
||||
# activate and check show_from
|
||||
t.activate!
|
||||
assert t.active?
|
||||
assert t.show_from.nil?
|
||||
end
|
||||
end
|
||||
|
||||
def test_clearing_show_from_activates_todo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue