Fixed timeago specs

This commit is contained in:
Phil Hughes 2017-02-13 09:01:09 +00:00
parent 8aa757aa53
commit a9c80dceb6
2 changed files with 4 additions and 4 deletions

View File

@ -192,7 +192,7 @@ describe 'Commits' do
commits = project.repository.commits(branch_name) commits = project.repository.commits(branch_name)
commits.each do |commit| commits.each do |commit|
expect(page).to have_content("committed #{commit.committed_date}") expect(page).to have_content("committed #{commit.committed_date.strftime("%b %d, %Y")}")
end end
end end
end end

View File

@ -193,8 +193,8 @@ describe ApplicationHelper do
describe 'time_ago_with_tooltip' do describe 'time_ago_with_tooltip' do
def element(*arguments) def element(*arguments)
Time.zone = 'UTC' Time.zone = 'UTC'
time = Time.zone.parse('2015-07-02 08:23') @time = Time.zone.parse('2015-07-02 08:23')
element = helper.time_ago_with_tooltip(time, *arguments) element = helper.time_ago_with_tooltip(@time, *arguments)
Nokogiri::HTML::DocumentFragment.parse(element).first_element_child Nokogiri::HTML::DocumentFragment.parse(element).first_element_child
end end
@ -204,7 +204,7 @@ describe ApplicationHelper do
end end
it 'includes the date string' do it 'includes the date string' do
expect(element.text).to eq '2015-07-02 08:23:00 UTC' expect(element.text).to eq @time.strftime("%b %d, %Y")
end end
it 'has a datetime attribute' do it 'has a datetime attribute' do