Skip to content
Snippets Groups Projects
Commit b145344e authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Fix flaky spec

parent c62e8ebb
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -182,15 +182,16 @@
context "if the 'first_deployed_to_production_at' time is already set" do
it "does not overwrite the older 'first_deployed_to_production_at' time" do
# Previous deploy
time = Time.now
Timecop.freeze(time) { service.execute }
service.execute
 
expect(merge_request.reload.metrics.first_deployed_to_production_at).to be_like_time(time)
expect(merge_request.reload.metrics.first_deployed_to_production_at).to be_like_time(deployment.finished_at)
 
# Current deploy
Timecop.freeze(time + 12.hours) { service.execute }
Timecop.travel(12.hours.from_now) do
service.execute
 
expect(merge_request.reload.metrics.first_deployed_to_production_at).to be_like_time(time)
expect(merge_request.reload.metrics.first_deployed_to_production_at).to be_like_time(deployment.finished_at)
end
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment