Merge pull request #347 from ChrisBr/fix_test_dates

Implements timecop to make tests independent from DateTime
This commit is contained in:
Christian Bruckmayer 2014-07-23 15:20:44 +02:00
commit 35c5116051
14 changed files with 42 additions and 38 deletions

View file

@ -18,17 +18,17 @@ feature Conference do
click_link 'Add vday'
expect(page.all('div.nested-fields').count == 1).to be true
page.
find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
set("#{Date.today.strftime('%Y')}")
find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
select("#{Date.today.strftime('%Y')}")
page.
find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
set("#{Date.today.strftime('%B')}")
find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
select("#{Date.today.strftime('%B')}")
page.
find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
set("#{Date.today.strftime('%-d')}")
find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
select("#{Date.today.strftime('%-d')}")
page.
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
set('Example Person')
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
set('Example Person')
click_button 'Update Conference'
expect(flash).
to eq('Volunteering options were successfully updated.')
@ -64,17 +64,17 @@ feature Conference do
click_link 'Add vday'
expect(page.all('div.nested-fields').count == 1).to be true
page.
find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
set("#{Date.today.strftime('%Y')}")
find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
select("#{Date.today.strftime('%Y')}")
page.
find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
set("#{Date.today.strftime('%B')}")
find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
select("#{Date.today.strftime('%B')}")
page.
find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
set("#{Date.today.strftime('%-d')}")
find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
select("#{Date.today.strftime('%-d')}")
page.
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
set('Example Person')
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
set('Example Person')
click_button 'Update Conference'
expect(flash).
to eq('Volunteering options were successfully updated.')