Guest User

Untitled

a guest
Oct 2nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.86 KB | None | 0 0
  1. Given /the following movies exist/ do |movies_table|
  2.   movies_table.hashes.each do |movie|
  3.     Movie.create!(movie)
  4.   end
  5. end
  6.  
  7. Then /I should see "(.*)" before "(.*)"/ do |e1, e2|
  8.   #  ensure that that e1 occurs before e2.
  9.   #  page.body is the entire content of the page as a string.
  10.   assert_match(/.*#{Regexp.escape(e1)}.*#{Regexp.escape(e2)}.*/m, page.body)
  11. end
  12.  
  13. When /I (un)?check the following ratings: (.*)/ do |uncheck, rating_list|
  14.   ratings = rating_list.split(/\s*,\s*/)
  15.   ratings.each do |rating|
  16.     step "I #{uncheck}check \"ratings_#{rating}\""
  17.   end
  18. end
  19.  
  20. Then /I should see all of the movies/ do
  21.   movies = Movie.all
  22.   movies.each do |movie|
  23.     step "I should see \"#{movie.title}\""
  24.   end
  25. end
  26.  
  27. Then /I should see no movie/ do
  28.   movies = Movie.all
  29.   movies.each do |movie|
  30.     step "I should not see \"#{movie.title}\""
  31.   end
  32. end
Add Comment
Please, Sign In to add comment