Freeze date in merge request status view spec

Previously, when this spec ran on the 28th of February, "one month ago"
isn't actually a month ago, it's "28 days ago".

Now we freeze the date to one that works as intended, since the point of
the test is only that it shows a relative date in the tooltip, not
necessarily that it's an exact, specific date.
parent 165e0cfb
......@@ -2,6 +2,12 @@
require 'spec_helper'
describe 'projects/issues/_merge_requests_status.html.haml' do
around do |ex|
Timecop.freeze(Date.new(2018, 7, 22)) do
ex.run
end
end
it 'shows date of status change in tooltip' do
merge_request = create(:merge_request, created_at: 1.month.ago)
......
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