Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: case451/hw3_rottenpotatoes
base: master
...
head fork: timko/hw3_rottenpotatoes
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 10 files changed
  • 0 commit comments
  • 6 contributors
Commits on Feb 09, 2012
@mbdriscoll mbdriscoll prevent infinite redirects when sorting without filters 4051607
Commits on Feb 10, 2012
@mbdriscoll mbdriscoll make language that refers to selecting Ratings be consistent ed6dd06
Commits on Feb 20, 2012
Richard Xia Added Gemfile.lock 29b93e8
Commits on May 01, 2012
@armandofox armandofox Added default (root) route in routes.rb
Fortified regexp for "home page" in features/support/paths.rb
Fixed typos in movie_steps
In sort_movie_list.feature, added getting-started hints about clicking
on the column header links
In movie list, gave table body its own element-ID so that "I should see
<rating>" can be scoped to that element, since all ratings ALWAYS appear
in the rating checkbox panel at top of page
77372a5
Commits on Aug 07, 2012
@ybakos ybakos Update features/sort_movie_list.feature
Fixing capitalization of I in last scenario.
ef1b371
Richard Xia Merge pull request #2 from ybakos/patch-1
Update features/sort_movie_list.feature
33dfcd4
Commits on Aug 21, 2012
@avneeshk91 avneeshk91 moved cucumber gems into test group in Gemfile to get rid of warnings…
… on rails server start
42d9ced
@maxfeldman14 maxfeldman14 Merge pull request #3 from avneeshk91/master
Remove Cucumber warnings in rails server
58d77e2
View
6 Gemfile
@@ -9,12 +9,14 @@ gem 'rails', '3.1.0'
group :development, :test do
gem 'sqlite3'
gem 'ruby-debug19', :require => 'ruby-debug'
- gem 'cucumber-rails'
- gem 'cucumber-rails-training-wheels'
gem 'database_cleaner'
gem 'capybara'
gem 'launchy'
end
+group :test do
+ gem 'cucumber-rails'
+ gem 'cucumber-rails-training-wheels'
+end
group :production do
# gem 'pg'
end
View
181 Gemfile.lock
@@ -0,0 +1,181 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.1.0)
+ actionpack (= 3.1.0)
+ mail (~> 2.3.0)
+ actionpack (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6)
+ rack (~> 1.3.2)
+ rack-cache (~> 1.0.3)
+ rack-mount (~> 0.8.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.0.0)
+ activemodel (3.1.0)
+ activesupport (= 3.1.0)
+ bcrypt-ruby (~> 3.0.0)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
+ arel (~> 2.2.1)
+ tzinfo (~> 0.3.29)
+ activeresource (3.1.0)
+ activemodel (= 3.1.0)
+ activesupport (= 3.1.0)
+ activesupport (3.1.0)
+ multi_json (~> 1.0)
+ addressable (2.3.2)
+ archive-tar-minitar (0.5.2)
+ arel (2.2.3)
+ bcrypt-ruby (3.0.1)
+ builder (3.0.0)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.3.5)
+ ffi (~> 1.0, >= 1.0.6)
+ coffee-rails (3.1.1)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.1.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.3)
+ columnize (0.3.6)
+ cucumber (1.2.1)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.11.0)
+ json (>= 1.4.6)
+ cucumber-rails (1.3.0)
+ capybara (>= 1.1.2)
+ cucumber (>= 1.1.8)
+ nokogiri (>= 1.5.0)
+ cucumber-rails-training-wheels (1.0.0)
+ cucumber-rails (>= 1.1.1)
+ database_cleaner (0.8.0)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ ffi (1.1.5)
+ gherkin (2.11.2)
+ json (>= 1.4.6)
+ haml (3.1.7)
+ hike (1.2.1)
+ i18n (0.6.0)
+ jquery-rails (2.1.1)
+ railties (>= 3.1.0, < 5.0)
+ thor (~> 0.14)
+ json (1.7.5)
+ launchy (2.1.2)
+ addressable (~> 2.3)
+ libv8 (3.3.10.4)
+ libwebsocket (0.1.5)
+ addressable
+ linecache19 (0.5.12)
+ ruby_core_source (>= 0.1.4)
+ mail (2.3.3)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.3.6)
+ nokogiri (1.5.5)
+ polyglot (0.3.3)
+ rack (1.3.6)
+ rack-cache (1.0.3)
+ rack (>= 0.4)
+ rack-mount (0.8.3)
+ rack (>= 1.0.0)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.1.0)
+ actionmailer (= 3.1.0)
+ actionpack (= 3.1.0)
+ activerecord (= 3.1.0)
+ activeresource (= 3.1.0)
+ activesupport (= 3.1.0)
+ bundler (~> 1.0)
+ railties (= 3.1.0)
+ railties (3.1.0)
+ actionpack (= 3.1.0)
+ activesupport (= 3.1.0)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ ruby-debug-base19 (0.11.25)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
+ ruby_core_source (0.1.5)
+ archive-tar-minitar (>= 0.5.2)
+ rubyzip (0.9.9)
+ sass (3.2.1)
+ sass-rails (3.1.6)
+ actionpack (~> 3.1.0)
+ railties (~> 3.1.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3.2)
+ selenium-webdriver (2.25.0)
+ childprocess (>= 0.2.5)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
+ rubyzip
+ sprockets (2.0.4)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ therubyracer (0.10.2)
+ libv8 (~> 3.3.10)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
+ uglifier (1.2.7)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.3)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ coffee-rails (~> 3.1.0)
+ cucumber-rails
+ cucumber-rails-training-wheels
+ database_cleaner
+ haml
+ jquery-rails
+ launchy
+ rails (= 3.1.0)
+ ruby-debug19
+ sass-rails (~> 3.1.0)
+ sqlite3
+ therubyracer
+ uglifier
View
7 app/controllers/movies_controller.rb
@@ -17,7 +17,12 @@ def index
@all_ratings = Movie.all_ratings
@selected_ratings = params[:ratings] || session[:ratings] || {}
- if params[:sort] != session[:sort] or params[:ratings] != session[:ratings]
+ if params[:sort] != session[:sort]
+ session[:sort] = sort
+ redirect_to :sort => sort, :ratings => @selected_ratings and return
+ end
+
+ if params[:ratings] != session[:ratings] and @selected_ratings != {}
session[:sort] = sort
session[:ratings] = @selected_ratings
redirect_to :sort => sort, :ratings => @selected_ratings and return
View
2  app/views/movies/index.html.haml
@@ -17,7 +17,7 @@
%th Rating
%th{:class => @date_header}= link_to 'Release Date', movies_path(:sort => 'release_date', :ratings => @selected_ratings), :id => 'release_date_header'
%th More Info
- %tbody
+ %tbody#movielist
- @movies.each do |movie|
%tr
%td= movie.title
View
58 config/routes.rb
@@ -1,59 +1,5 @@
Rottenpotatoes::Application.routes.draw do
- # The priority is based upon order of creation:
- # first created -> highest priority.
-
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
resources :movies
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => 'welcome#index'
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id(.:format)))'
+ # map '/' to be a redirect to '/movies'
+ root :to => redirect('/movies')
end
View
BIN  db/development.sqlite3
Binary file not shown
View
4 features/filter_movie_list.feature
@@ -28,8 +28,8 @@ Scenario: restrict to movies with 'PG' or 'R' ratings
# 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
+Scenario: no ratings selected
# see assignment
-Scenario: all checkboxes selected
+Scenario: all ratings selected
# see assignment
View
2  features/sort_movie_list.feature
@@ -22,8 +22,10 @@ Background: movies have been added to database
And I am on the RottenPotatoes home page
Scenario: sort movies alphabetically
+ When I follow "Movie Title"
# your steps here
Scenario: sort movies in increasing order of release date
+ When I follow "Release Date"
# your steps here
View
2  features/step_definitions/movie_steps.rb
@@ -5,6 +5,7 @@
# 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
+ flunk "Unimplemented"
end
# Make sure that one string (regexp) occurs before or after another one
@@ -13,6 +14,7 @@
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.
+ flunk "Unimplemented"
end
# Make it easier to express checking or unchecking several boxes at once
View
4 features/support/paths.rb
@@ -13,8 +13,8 @@ module NavigationHelpers
def path_to(page_name)
case page_name
- when /^the home\s?page$/
- '/'
+ when /^the (RottenPotatoes )?home\s?page$/ then '/movies'
+ when /^the movies page$/ then '/movies'
# Add more mappings here.
# Here is an example that pulls values out of the Regexp:

No commit comments for this range

Something went wrong with that request. Please try again.