summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-02-28 17:21:01 -0800
committerRobert Speicher <rspeicher@gmail.com>2019-02-28 17:21:01 -0800
commita05aba61c71d82117d4dfbf60430c0e4313b468b (patch)
tree0e5db70a903cd0e9e5485f4f3666faec974d0081 /spec/views
parent165e0cfb214047249640ef5c3ca22c1b26035943 (diff)
downloadgitlab-ce-a05aba61c71d82117d4dfbf60430c0e4313b468b.tar.gz
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/views')
-rw-r--r--spec/views/projects/issues/_merge_requests_status.html.haml_spec.rb6
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)