diff options
Diffstat (limited to 'spec/serializers/entity_date_helper_spec.rb')
-rw-r--r-- | spec/serializers/entity_date_helper_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/serializers/entity_date_helper_spec.rb b/spec/serializers/entity_date_helper_spec.rb index 5a4571339b3..70094991c09 100644 --- a/spec/serializers/entity_date_helper_spec.rb +++ b/spec/serializers/entity_date_helper_spec.rb @@ -47,8 +47,10 @@ RSpec.describe EntityDateHelper do end describe '#remaining_days_in_words' do + let(:current_time) { Time.utc(2017, 3, 17) } + around do |example| - travel_to(Time.utc(2017, 3, 17)) { example.run } + travel_to(current_time) { example.run } end context 'when less than 31 days remaining' do @@ -74,10 +76,10 @@ RSpec.describe EntityDateHelper do expect(milestone_remaining).to eq("<strong>1</strong> day remaining") end - it 'returns 1 day remaining when queried mid-day' do - travel_back + context 'when queried mid-day' do + let(:current_time) { Time.utc(2017, 3, 17, 13, 10) } - travel_to(Time.utc(2017, 3, 17, 13, 10)) do + it 'returns 1 day remaining' do expect(milestone_remaining).to eq("<strong>1</strong> day remaining") end end |