summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-10-29 22:36:28 +0100
committerWinnie Hellmann <winnie@gitlab.com>2018-11-06 16:59:50 +0100
commit5ad2b415a094872d524b630a4dcf9e236d833eeb (patch)
tree9b3133bee70e47c1c9c0b9ed722d34ebef03bbea
parentd0c58a97c8a053c0beec7c13c1c6ec5042120ef1 (diff)
downloadgitlab-ce-winh-timecop-frontend-fixtures.tar.gz
Set a fixed date for frontend fixtureswinh-timecop-frontend-fixtures
-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)