diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-03-01 04:21:01 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-03-01 04:21:01 +0300 |
commit | a05aba61c71d82117d4dfbf60430c0e4313b468b (patch) | |
tree | 0e5db70a903cd0e9e5485f4f3666faec974d0081 /spec | |
parent | 165e0cfb214047249640ef5c3ca22c1b26035943 (diff) |
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.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb b/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb index 02c225292ce..9424795749d 100644 --- a/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb +++ b/spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb @@ -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) |