forked from aren19-zz/hw4_rottenpotatoes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added feature files and step def skeletons
- Loading branch information
1 parent
48a2e0d
commit 6ae3a2d
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |