diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 16:49:52 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 16:49:52 -0400 |
commit | ff27747ec7cadd6937d5ca9a077886f915a89c1d (patch) | |
tree | b7348e40b1ca2b333eb1239a7ed45975e3e09676 /spec | |
parent | 1c4bf0e4747e9eaa7b43c57dec5b4f0d20817cb8 (diff) | |
download | gitlab-ce-ff27747ec7cadd6937d5ca9a077886f915a89c1d.tar.gz |
Fix timezone-based time_ago_with_tooltip spec failures
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 34fe08f5545..a62c801e6a2 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -242,7 +242,8 @@ describe ApplicationHelper do describe 'time_ago_with_tooltip' do def element(*arguments) - time = Time.parse('2015-07-02 08:00') + Time.zone = 'UTC' + time = Time.zone.parse('2015-07-02 08:00') element = time_ago_with_tooltip(time, *arguments) Nokogiri::HTML::DocumentFragment.parse(element).first_element_child @@ -253,15 +254,15 @@ describe ApplicationHelper do end it 'includes the date string' do - expect(element.text).to match %r{2015-07-02 \d{2}:\d{2}:\d{2}} + expect(element.text).to eq '2015-07-02 08:00:00 UTC' end it 'has a datetime attribute' do - expect(element.attr('datetime')).to eq '2015-07-02T12:00:00Z' + expect(element.attr('datetime')).to eq '2015-07-02T08:00:00Z' end it 'has a formatted title attribute' do - expect(element.attr('title')).to eq 'Jul 02, 2015 12:00pm' + expect(element.attr('title')).to eq 'Jul 02, 2015 8:00am' end it 'includes a default js-timeago class' do |