Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalshah committed Jan 4, 2018
1 parent f42c6f0 commit 5df052f
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -353,25 +353,25 @@ class Teacher1819ApplicationTest < ActiveSupport::TestCase
end

test 'accepted_at updates times' do
time_1 = Date.today.to_time
time_2 = Date.tomorrow.to_time
today = Date.today.to_time
tomorrow = Date.tomorrow.to_time
application = create :pd_teacher1819_application
assert_nil application.accepted_at

Timecop.freeze(time_1) do
Timecop.freeze(today) do
application.update(status: 'accepted')
application.reload
assert_equal time_1, application.accepted_at.to_time
assert_equal today, application.accepted_at.to_time

application.update(status: 'declined')
application.reload
assert_nil application.accepted_at
end

Timecop.freeze(time_2) do
Timecop.freeze(tomorrow) do
application.update(status: 'accepted')
application.reload
assert_equal time_2, application.accepted_at.to_time
assert_equal tomorrow, application.accepted_at.to_time
end
end
end
Expand Down

0 comments on commit 5df052f

Please sign in to comment.