Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Completed scenarios for filter movie list successfully

  • Loading branch information...
commit 58c1afb6905a1b1caaae5423bbb476dd7d2d0a76 1 parent f543c72
@chinpira authored
View
4 features/filter_movie_list.feature
@@ -47,7 +47,9 @@ Scenario: restrict to movies with 'PG' or 'R' ratings
Scenario: no ratings selected
# see assignment
-
+ When I uncheck all of the ratings
+ And I press "ratings_submit"
+ Then I should see none of the movies
Scenario: all ratings selected
# see assignment
View
15 features/step_definitions/movie_steps.rb
@@ -42,11 +42,16 @@
end
end
-When /I check all of the ratings/ do
+When /I (un)?check all of the ratings/ do |uncheck|
ratings_list = Movie.all_ratings
ratings_list.each do |rating|
- puts "Checking rating: ratings_" + rating
- check("ratings_" + rating)
+ if uncheck.nil?
+ puts "Checking rating: ratings_" + rating
+ check("ratings_" + rating)
+ else
+ puts "Unchecking rating: ratings_" + rating
+ uncheck("ratings_" + rating)
+ end
end
end
@@ -55,3 +60,7 @@
puts "Total number of movies in database: #{movie_count}"
(page.all("table#movies tr").count - 1).should == movie_count
end
+
+Then /I should see none of the movies/ do
+ (page.all("table#movies tr").count - 1).should == 0
+end
Please sign in to comment.
Something went wrong with that request. Please try again.