diff options
author | Sean McGivern <sean@gitlab.com> | 2016-12-30 09:23:51 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-12-30 09:23:51 +0000 |
commit | f5bd39ce02af4e14715d6b58da10c2712e6bed8c (patch) | |
tree | 8b4d20d37b9390cf76cbbb33d78e53fdd1fb39a9 | |
parent | b0765d244f7e19955d4f803dde816dc9161a95a5 (diff) | |
download | gitlab-ce-f5bd39ce02af4e14715d6b58da10c2712e6bed8c.tar.gz |
Stub, not set, timezone in specs
Setting the timezone could have an unexpected impact on other specs.
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 92053e5a7c6..3bb6c564e40 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -191,8 +191,11 @@ describe ApplicationHelper do end describe 'time_ago_with_tooltip' do + before do + allow(Time).to receive(:zone).and_return(ActiveSupport::TimeZone.new('UTC')) + end + def element(*arguments) - Time.zone = 'UTC' time = Time.zone.parse('2015-07-02 08:23') element = helper.time_ago_with_tooltip(time, *arguments) |