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.
Merge remote branch 'hw3_public/master' into hw3_start
Conflicts: .gitignore Gemfile app/assets/stylesheets/application.css app/controllers/movies_controller.rb app/models/movie.rb app/views/movies/index.html.haml config/cucumber.yml config/database.yml config/routes.rb lib/tasks/cucumber.rake
- Loading branch information
Showing
18 changed files
with
560 additions
and
13 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#* | ||
\#*\# | ||
*~ | ||
TAGS | ||
db/schema.rb | ||
|
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
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
Empty file.
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
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
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
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,25 @@ | ||
class AddMoreMovies < ActiveRecord::Migration | ||
MORE_MOVIES = [ | ||
{:title => 'Aladdin', :rating => 'G', :release_date => '25-Nov-1992'}, | ||
{:title => 'The Terminator', :rating => 'R', :release_date => '26-Oct-1984'}, | ||
{:title => 'When Harry Met Sally', :rating => 'R', :release_date => '21-Jul-1989'}, | ||
{:title => 'The Help', :rating => 'PG-13', :release_date => '10-Aug-2011'}, | ||
{:title => 'Chocolat', :rating => 'PG-13', :release_date => '5-Jan-2001'}, | ||
{:title => 'Amelie', :rating => 'R', :release_date => '25-Apr-2001'}, | ||
{:title => '2001: A Space Odyssey', :rating => 'G', :release_date => '6-Apr-1968'}, | ||
{:title => 'The Incredibles', :rating => 'PG', :release_date => '5-Nov-2004'}, | ||
{:title => 'Raiders of the Lost Ark', :rating => 'PG', :release_date => '12-Jun-1981'}, | ||
{:title => 'Chicken Run', :rating => 'G', :release_date => '21-Jun-2000'}, | ||
] | ||
def up | ||
MORE_MOVIES.each do |movie| | ||
Movie.create!(movie) | ||
end | ||
end | ||
|
||
def down | ||
MORE_MOVIES.each do |movie| | ||
Movie.find_by_title_and_rating(movie[:title], movie[:rating]).destroy | ||
end | ||
end | ||
end |
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,35 @@ | ||
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 | | ||
|
||
And I am on the RottenPotatoes home page | ||
|
||
Scenario: restrict to movies with 'PG' or 'R' ratings | ||
# enter step(s) to check the 'PG' and 'R' checkboxes | ||
# enter step(s) to uncheck all other checkboxes | ||
# enter step to "submit" the search form on the homepage | ||
# enter step(s) to ensure that PG and R movies are visible | ||
# enter step(s) to ensure that other movies are not visible | ||
|
||
Scenario: no checkboxes selected | ||
# see assignment | ||
|
||
Scenario: all checkboxes selected | ||
# see assignment |
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,29 @@ | ||
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 see movies sorted by title or release date | ||
|
||
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 | | ||
|
||
And I am on the RottenPotatoes home page | ||
|
||
Feature: sort movies alphabetically | ||
# your steps here | ||
|
||
Feature: sort movies in increasing order of release date | ||
# 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,26 @@ | ||
# 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 "(.*)"/ do |e1, e2| | ||
# ensure that that e1 occurs before e2. | ||
# page.content is the entire content of the page as a string. | ||
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 |
Oops, something went wrong.