Use local time zone in tests instead of hardcoded

This commit is contained in:
Julius Pabrinkis
2017-04-04 17:23:07 +01:00
parent dc69c6e825
commit 7c7933f8bb

View File

@@ -147,9 +147,8 @@ feature %q{
page.should have_content 'Your order cycle has been created.'
page.should have_selector 'a', text: 'Plums & Avos'
page.should have_selector "input[value='2040-11-06 06:00:00 +1100']"
page.should have_selector "input[value='2040-11-13 17:00:00 +1100']"
page.should have_selector "input[value='#{Time.zone.local(2040, 11, 06, 06, 00, 00)}']"
page.should have_selector "input[value='#{Time.zone.local(2040, 11, 13, 17, 00, 00)}']"
page.should have_content 'My coordinator'
page.should have_selector 'td.suppliers', text: 'My supplier'
@@ -382,8 +381,8 @@ feature %q{
page.should have_selector 'a', text: 'Plums & Avos'
page.should have_selector "input[value='2040-11-06 06:00:00 +1100']"
page.should have_selector "input[value='2040-11-13 17:00:00 +1100']"
page.should have_selector "input[value='#{Time.zone.local(2040, 11, 06, 06, 00, 00)}']"
page.should have_selector "input[value='#{Time.zone.local(2040, 11, 13, 17, 00, 00)}']"
page.should have_content coordinator.name
page.should have_selector 'td.suppliers', text: 'My supplier'
@@ -907,8 +906,8 @@ feature %q{
# Then my order cycle should have been created
page.should have_content 'Your order cycle has been created.'
page.should have_selector 'a', text: 'Plums & Avos'
page.should have_selector "input[value='2040-10-17 06:00:00 +1100']"
page.should have_selector "input[value='2040-10-24 17:00:00 +1100']"
page.should have_selector "input[value='#{Time.zone.local(2040, 10, 17, 06, 00, 00)}']"
page.should have_selector "input[value='#{Time.zone.local(2040, 10, 24, 17, 00, 00)}']"
# And it should have some variants selected
oc = OrderCycle.last
@@ -995,8 +994,8 @@ feature %q{
# Then my order cycle should have been updated
page.should have_content 'Your order cycle has been updated.'
page.should have_selector 'a', text: 'Plums & Avos'
page.should have_selector "input[value='2040-10-17 06:00:00 +1100']"
page.should have_selector "input[value='2040-10-24 17:00:00 +1100']"
page.should have_selector "input[value='#{Time.zone.local(2040, 10, 17, 06, 00, 00)}']"
page.should have_selector "input[value='#{Time.zone.local(2040, 10, 24, 17, 00, 00)}']"
# And it should have a variant selected
oc = OrderCycle.last