Skip to content

Commit

Permalink
added feature files and step def skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
armandofox committed Feb 3, 2012
1 parent 48a2e0d commit 6ae3a2d
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
24 changes: 24 additions & 0 deletions features/filter_movie_list.feature
@@ -0,0 +1,24 @@
Feature: display list of movies filtered by MPAA rating

As a concerned parent
So that I can quickly browse movies appropriate for my family
I want to see movies matching only certain MPAA ratings

Background: movies have been added to database

Given the following movies exist:
| title | rating | release_date |
| Aladdin | G | 25-Nov-1992 |
| The Terminator | R | 26-Oct-1984 |
| When Harry Met Sally | R | 21-Jul-1989 |
| The Help | PG-13 | 10-Aug-2011 |
| Chocolat | PG-13 | 5-Jan-2001 |
| Amelie | R | 25-Apr-2001 |
| 2001: A Space Odyssey | G | 6-Apr-1968 |
| The Incredibles | PG | 5-Nov-2004 |
| Raiders of the Lost Ark | PG | 12-Jun-1981 |
| Chicken Run | G | 21-Jun-2000 |




31 changes: 31 additions & 0 deletions features/sort_movie_list.feature
@@ -0,0 +1,31 @@
Feature: display list of movies sorted by different criteria

As an avid moviegoer
So that I can quickly browse movies based on my preferences
I want to be able to sort movies by title or release date

Background: movies are added to database

Given I have added the following movies:
| title | rating | release_date |
| Aladdin | G | 25-Nov-1992 |
| The Terminator | R | 26-Oct-1984 |
| When Harry Met Sally | R | 21-Jul-1989 |
| The Help | PG-13 | 10-Aug-2011 |
| Chocolat | PG-13 | 5-Jan-2001 |
| Amelie | R | 25-Apr-2001 |
| 2001: A Space Odyssey | G | 6-Apr-1968 |
| The Incredibles | PG | 5-Nov-2004 |
| Raiders of the Lost Ark | PG | 12-Jun-1981 |
| Chicken Run | G | 21-Jun-2000 |

Feature: sort movies alphabetically

Given I am on the RottenPotatoes home page
# your steps here

Feature: sort movies in increasing order of release_date

Given I am on the RottenPotatoes home page
# your steps here

18 changes: 18 additions & 0 deletions features/step_definitions/movie_steps.rb
@@ -0,0 +1,18 @@
# Add a declarative step here for populating the DB with movies.

Given /the following movies exist/ do |movies_table|
movies_table.hashes.each do |movie|
# each returned element will be a hash whose key is the table header.
# you should arrange to add that movie to the database here.
end
end

# 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|
# 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

0 comments on commit 6ae3a2d

Please sign in to comment.