Commit 646dea63 authored by Stan Hu's avatar Stan Hu

Merge branch 'ajk-fix-flaky-spec-for-daylight-savings' into 'master'

Fix flaky spec by setting a fixed date

See merge request gitlab-org/gitlab!57646
parents 9f962a44 35e160e8
...@@ -8,7 +8,9 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do ...@@ -8,7 +8,9 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do
let_it_be(:user_with_permissions) { create(:user) } let_it_be(:user_with_permissions) { create(:user) }
let_it_be(:user_without_permissions) { create(:user) } let_it_be(:user_without_permissions) { create(:user) }
let_it_be(:current_user) { user_with_permissions } let_it_be(:current_user) { user_with_permissions }
let_it_be(:starts_at) { Time.current.change(usec: 0) }
let(:execution_time) { DateTime.new(2021, 3, 1, 4, 5, 6) }
let(:starts_at) { DateTime.new(2021, 3, 1) }
let(:participants) do let(:participants) do
[ [
...@@ -40,7 +42,9 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do ...@@ -40,7 +42,9 @@ RSpec.describe IncidentManagement::OncallRotations::CreateService do
end end
end end
subject(:execute) { service.execute } subject(:execute) do
travel_to(execution_time) { service.execute }
end
context 'when the current_user is anonymous' do context 'when the current_user is anonymous' do
let(:current_user) { nil } let(:current_user) { nil }
......
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