diff --git a/ee/spec/models/gitlab_subscription_spec.rb b/ee/spec/models/gitlab_subscription_spec.rb index c31aadccf33cd3d2d7a8f54195f2df91a3951ab5..c425e4491446be29b39a942da5906d592e90144b 100644 --- a/ee/spec/models/gitlab_subscription_spec.rb +++ b/ee/spec/models/gitlab_subscription_spec.rb @@ -9,8 +9,8 @@ let_it_be(plan) { create(plan) } end - describe 'default values', time_travel: 30.days do - specify do + describe 'default values', :freeze_time do + it 'defaults start_date to the current date' do expect(subject.start_date).to eq(Date.today) end end diff --git a/spec/support/time_travel.rb b/spec/support/time_travel.rb index 332b37c1f2bbfc4bacd0524a171fe220eb40ed4f..9dfbfd205242f1fbd97ad7529435ee1653666ad7 100644 --- a/spec/support/time_travel.rb +++ b/spec/support/time_travel.rb @@ -9,14 +9,6 @@ freeze_time { example.run } end - config.around(:example, :time_travel) do |example| - duration = example.metadata[:time_travel] - - raise 'The time_travel RSpec metadata must have an ActiveSupport::Duration value (such as `30.days`).' unless duration.is_a?(ActiveSupport::Duration) - - travel(duration) { example.run } - end - config.around(:example, :time_travel_to) do |example| date_or_time = example.metadata[:time_travel_to] diff --git a/spec/support_specs/time_travel_spec.rb b/spec/support_specs/time_travel_spec.rb index 8d80a88944344c81151807e498ba439b94162361..8fa51c0c1f0e27a3393d864d35b1d1abe516e4ef 100644 --- a/spec/support_specs/time_travel_spec.rb +++ b/spec/support_specs/time_travel_spec.rb @@ -9,18 +9,6 @@ end end - describe ':time_travel' do - today = Date.current - - it 'time-travels by the given duration', time_travel: 3.days do - expect(Date.current).to eq(today + 3.days) - end - - it 'works with negative durations', time_travel: -5.days do - expect(Date.current).to eq(today - 5.days) - end - end - describe ':time_travel_to' do it 'time-travels to the specified date', time_travel_to: '2020-01-01' do expect(Date.current).to eq(Date.new(2020, 1, 1))