Merge pull request #347 from ChrisBr/fix_test_dates
Implements timecop to make tests independent from DateTime
This commit is contained in:
commit
35c5116051
14 changed files with 42 additions and 38 deletions
|
|
@ -3,15 +3,12 @@ require 'spec_helper'
|
|||
describe 'admin/callforpapers/show' do
|
||||
|
||||
it 'renders callforpapers details' do
|
||||
@conference = create(:conference)
|
||||
assign :conference, @conference
|
||||
assign :cfp, stub_model(CallForPapers, start_date: Date.today,
|
||||
end_date: Date.today + 7.days,
|
||||
description: 'Lorem Ipsum Dolsum')
|
||||
assign :conference, create(:conference)
|
||||
assign :cfp, create(:call_for_papers)
|
||||
render
|
||||
expect(rendered).to include(Date.today.strftime('%Y-%m-%d'))
|
||||
expect(rendered).to include(1.day.ago.strftime('%Y-%m-%d'))
|
||||
expect(rendered).to include(7.days.from_now.strftime('%Y-%m-%d'))
|
||||
expect(rendered).to include('Lorem Ipsum Dolsum')
|
||||
expect(rendered).to include('We call for papers')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue