Skip to content

Commit

Permalink
Fixed test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsrohde committed Apr 23, 2015
1 parent c69568f commit c1b8607
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/features/prior_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@

it 'should allow adding related pfts', js: true do
click_link 'View Related PFTs'
page.select 'temperate.Northern_Pine', from: 'pft_id'
click_button 'Select'
page.should have_content 'temperate.Northern_Pine'

# The select box is empty, so first we have to unlink a pft so we have something to select:
# now do clean-up
page.find(:xpath, ".//table/tbody/tr[preceding-sibling::tr/th/text() = 'Name'][contains(td[3], 'temperate.Northern_Pine')]/td/a[text() = 'X']").click
# If we're using Selenium, we have to deal with the modal dialogue:
if page.driver.is_a? Capybara::Selenium::Driver
a = page.driver.browser.switch_to.alert
a.accept
end

page.select 'temperate.Northern_Pine', from: 'pft_id'
click_button 'Select'
page.should have_content 'temperate.Northern_Pine'

end

Expand Down

0 comments on commit c1b8607

Please sign in to comment.