Skip to content

Commit

Permalink
Added default (root) route in routes.rb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
armandofox committed May 1, 2012
1 parent 29b93e8 commit 77372a5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 61 deletions.
2 changes: 1 addition & 1 deletion app/views/movies/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 2 additions & 56 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions features/sort_movie_list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 2 additions & 2 deletions features/step_definitions/movie_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +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
assert false, "Unimplmemented"
flunk "Unimplemented"
end

# Make sure that one string (regexp) occurs before or after another one
Expand All @@ -14,7 +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.
assert false, "Unimplmemented"
flunk "Unimplemented"
end

# Make it easier to express checking or unchecking several boxes at once
Expand Down
4 changes: 2 additions & 2 deletions features/support/paths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 77372a5

Please sign in to comment.