diff options
author | Sean McGivern <sean@gitlab.com> | 2016-12-30 09:29:00 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-12-30 09:29:00 +0000 |
commit | 856abd48f130f3eab29ee24f877648aa40680e09 (patch) | |
tree | 683a4b69344925d11ebc26c9384e4dd8e531128b | |
parent | f5bd39ce02af4e14715d6b58da10c2712e6bed8c (diff) | |
download | gitlab-ce-fix-spec-timezones.tar.gz |
Warn when running TZ-dependent spec outside UTCfix-spec-timezones
-rw-r--r-- | spec/features/dashboard/datetime_on_tooltips_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/features/dashboard/datetime_on_tooltips_spec.rb b/spec/features/dashboard/datetime_on_tooltips_spec.rb index 44dfc2dff45..3f97b886488 100644 --- a/spec/features/dashboard/datetime_on_tooltips_spec.rb +++ b/spec/features/dashboard/datetime_on_tooltips_spec.rb @@ -8,6 +8,14 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do let(:created_date) { Date.yesterday.to_time } let(:expected_format) { created_date.strftime('%b %-d, %Y %l:%M%P UTC') } + before(:all) do + if Time.now.getlocal.zone != 'UTC' + $stderr.puts "WARNING: This spec (#{__FILE__}) only works in the UTC time zone." + $stderr.puts '' + $stderr.puts 'Set TZ=UTC when running this spec to force the time zone to UTC.' + end + end + context 'on the activity tab' do before do project.team << [user, :master] @@ -17,7 +25,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do login_as user visit user_path(user) - wait_for_ajax() + wait_for_ajax page.find('.js-timeago').hover end @@ -34,7 +42,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do login_as user visit user_snippets_path(user) - wait_for_ajax() + wait_for_ajax page.find('.js-timeago.snippet-created-ago').hover end |