Commit d69c920a authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '345345-remove-flaky-time_travel-spec-metadata-tag' into 'master'

Remove flaky :time_travel RSpec metadata tag

See merge request gitlab-org/gitlab!74253
parents 0153b060 e7d5e6a2
......@@ -9,8 +9,8 @@ RSpec.describe GitlabSubscription, :saas do
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
......
......@@ -9,14 +9,6 @@ RSpec.configure do |config|
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]
......
......@@ -9,18 +9,6 @@ RSpec.describe 'time travel' do
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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment