saasbook

declarative_steps.rb

Aug 15th, 2013
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.45 KB | None | 0 0
  1. Given /I have added "(.*)" with rating "(.*)"/ do |title, rating|
  2.   steps %Q{
  3.     Given I am on the Create New Movie page
  4.     When  I fill in "Title" with "#{title}"
  5.     And   I select "#{rating}" from "Rating"
  6.     And   I press "Save Changes"
  7.   }
  8. end
  9.  
  10. Then /I should see "(.*)" before "(.*)" on (.*)/ do |string1, string2, path|
  11.   step "I am on #{path}"
  12.   regexp = /#{string1}.*#{string2}/m #  /m means match across newlines
  13.   page.body.should =~ regexp
  14. end
Add Comment
Please, Sign In to add comment