Commit b5e141c3 authored by Stan Hu's avatar Stan Hu

Fix deploy freeze tests failing on weekends

The test was attempting to check that a deploy freeze on the weekend
would prevent a job from being created, but the Timecop was not
surrounding the right block.

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/224786
parent f9fd6b55
...@@ -2231,8 +2231,8 @@ RSpec.describe Ci::CreatePipelineService do ...@@ -2231,8 +2231,8 @@ RSpec.describe Ci::CreatePipelineService do
end end
context 'when outside freeze period' do context 'when outside freeze period' do
Timecop.freeze(2020, 4, 10, 22, 59) do it 'creates two jobs' do
it 'creates two jobs' do Timecop.freeze(2020, 4, 10, 22, 59) do
expect(pipeline).to be_persisted expect(pipeline).to be_persisted
expect(build_names).to contain_exactly('test-job', 'deploy-job') expect(build_names).to contain_exactly('test-job', 'deploy-job')
end end
...@@ -2265,8 +2265,8 @@ RSpec.describe Ci::CreatePipelineService do ...@@ -2265,8 +2265,8 @@ RSpec.describe Ci::CreatePipelineService do
end end
context 'when outside freeze period' do context 'when outside freeze period' do
Timecop.freeze(2020, 4, 10, 22, 59) do it 'creates two jobs' do
it 'creates two jobs' do Timecop.freeze(2020, 4, 10, 22, 59) do
expect(pipeline).to be_persisted expect(pipeline).to be_persisted
expect(build_names).to contain_exactly('deploy-job') expect(build_names).to contain_exactly('deploy-job')
end end
......
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