summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-12-10 16:01:10 +0000
committerRémy Coutable <remy@rymai.me>2018-12-10 16:01:10 +0000
commitcd82c38916915d96a4de8c7f7f269c43454d9a75 (patch)
tree8632b53482438fe13ab79fa2b5c6129b49fd148b /spec
parent849778d146add869f4ef0528eea0ca2e115db1fa (diff)
parentd32e91d0cf4553175371881e5ecbc8a2bab6d2a2 (diff)
downloadgitlab-ce-cd82c38916915d96a4de8c7f7f269c43454d9a75.tar.gz
Merge branch 'winh-timecop-frontend-fixtures' into 'master'
Set a fixed date for frontend fixtures See merge request gitlab-org/gitlab-ce!22672
Diffstat (limited to 'spec')
-rw-r--r--spec/support/helpers/javascript_fixtures_helpers.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/helpers/javascript_fixtures_helpers.rb b/spec/support/helpers/javascript_fixtures_helpers.rb
index 086a345dca8..89c5ec7a718 100644
--- a/spec/support/helpers/javascript_fixtures_helpers.rb
+++ b/spec/support/helpers/javascript_fixtures_helpers.rb
@@ -6,6 +6,13 @@ module JavaScriptFixturesHelpers
FIXTURE_PATH = 'spec/javascripts/fixtures'.freeze
+ def self.included(base)
+ base.around do |example|
+ # pick an arbitrary date from the past, so tests are not time dependent
+ Timecop.freeze(Time.utc(2015, 7, 3, 10)) { example.run }
+ end
+ end
+
# Public: Removes all fixture files from given directory
#
# directory_name - directory of the fixtures (relative to FIXTURE_PATH)