diff options
author | Rémy Coutable <remy@rymai.me> | 2018-12-10 16:01:10 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-12-17 16:11:39 +0100 |
commit | 12ca2e6e7ed69fdb77ac4059eea14c66f2bc97e3 (patch) | |
tree | e44679d1f038b19e197ad590a940e52121ceb34c | |
parent | 567ef88365a972770baf7727a5413d7dc44d030a (diff) | |
download | gitlab-ce-12ca2e6e7ed69fdb77ac4059eea14c66f2bc97e3.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
-rw-r--r-- | spec/support/helpers/javascript_fixtures_helpers.rb | 7 |
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) |