Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-10-30 00:36:28 +0300
committerWinnie Hellmann <winnie@gitlab.com>2018-12-10 15:47:38 +0300
commitd32e91d0cf4553175371881e5ecbc8a2bab6d2a2 (patch)
tree79ba4c2bcc981068b99c83d6dc095009799803bb /spec/support
parent5a727a4d36674d02369f4ef8ed257ea9d17570e7 (diff)
Set a fixed date for frontend fixtures
Diffstat (limited to 'spec/support')
-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)