Update and fix test kitchet to be conformant with poltergeist

This commit is contained in:
KalabiYau 2014-07-04 22:35:47 +02:00 committed by Artem Chernikov
parent 7f710ec72d
commit dbb210908b
6 changed files with 62 additions and 34 deletions

View file

@ -12,6 +12,7 @@ feature Sponsor do
conference = create(:conference)
conference.sponsorship_levels << create(:sponsorship_level, conference: conference)
sign_in create(user)
visit admin_conference_sponsors_path(
conference_id: conference.short_title)
# Add sponsors
@ -36,6 +37,7 @@ feature Sponsor do
find(:css, "select[id^='conference_sponsors_attributes_']"\
"[id$='_sponsorship_level_id']").
find(:option, 'Platin').select_option
click_button 'Update Conference'
expect(flash).to eq('Sponsorships were successfully updated.')
@ -55,7 +57,7 @@ feature Sponsor do
value).to eq('http://www.example.com')
expect(find('div.nested-fields:nth-of-type(1)'\
' div:nth-of-type(5) select:nth-of-type(1)').
' div:nth-of-type(5) select:nth-of-type(1)').find('option[selected]').
text).to eq('Platin')
# Remove sponsor

View file

@ -103,9 +103,10 @@ feature Conference do
expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
' div:nth-of-type(2) textarea').
value).to eq('Example Description')
expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
' div:nth-of-type(3) select:nth-of-type(1)').
text).to eq("#{Date.today.strftime}")
' div:nth-of-type(3) select:nth-of-type(1)').find('option[selected]').
text).to eq(Date.today.strftime)
# Remove vposition
click_link 'Remove vposition'