saasbook

declarative_steps.rb

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