Skip to content

Commit

Permalink
added skeleton for "When i check the following ratings" step def
Browse files Browse the repository at this point in the history
  • Loading branch information
armandofox committed Feb 3, 2012
1 parent ed3d607 commit 22244ae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion features/step_definitions/movie_steps.rb
Expand Up @@ -10,9 +10,19 @@
# Make sure that one string (regexp) occurs before or after another one
# on the same page

Then "I should see (.*) (before|after) (.*)" do |e1, order, e2|
Then /I should see "(.*)" (before|after) "(.*)"/ do |e1, order, e2|
# assign a variable 'regex' here that creates a regular expression
# to match the page content against, to make sure that e1 occurs
# before or after e2 as specified in the step.
page.content.should match(regex)
end

# Make it easier to express checking or unchecking several boxes at once
# "When I uncheck the following ratings: PG, G, R"
# "When I check the following ratings: G"

When /I (un)?check the following ratings: (.*)/ do |uncheck, rating_list|
# HINT: use String#split to split up the rating_list, then
# iterate over the ratings and reuse the "When I check..." or
# "When I uncheck..." steps in lines 89-95 of web_steps.rb
end

0 comments on commit 22244ae

Please sign in to comment.