From d32e91d0cf4553175371881e5ecbc8a2bab6d2a2 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Mon, 29 Oct 2018 22:36:28 +0100 Subject: Set a fixed date for frontend fixtures --- spec/support/helpers/javascript_fixtures_helpers.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/support/helpers/javascript_fixtures_helpers.rb') 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) -- cgit v1.2.1