Permalink
Browse files

restricted routing for Timesheets to only the actions that are implem…

…ented
  • Loading branch information...
1 parent 2541e2b commit 2da6c3a247d19602d3e8a59a389e60cc2792277e @enricob committed Apr 13, 2009
Showing with 1 addition and 9 deletions.
  1. +1 −1 config/routes.rb
  2. +0 −8 spec/routing/timesheets_routing_spec.rb
View
@@ -6,7 +6,7 @@
map.resource :account, :controller => "users", :except => [:index, :destroy]
map.resources :users, :except => [:index, :destroy]
- map.resources :timesheets
+ map.resources :timesheets, :only => [:index, :create, :update]
map.connect '/timesheets/:year/:month/:day', :controller => "timesheets", :action => "edit"
map.login '/login', :controller => "user_sessions", :action => "new"
@@ -6,10 +6,6 @@
route_for(:controller => "timesheets", :action => "index").should == "/timesheets"
end
- it "maps #edit" do
- route_for(:controller => "timesheets", :action => "edit", :id => "1").should == "/timesheets/1/edit"
- end
-
it "maps #create" do
route_for(:controller => "timesheets", :action => "create").should == {:path => "/timesheets", :method => :post}
end
@@ -28,10 +24,6 @@
params_from(:get, '/timesheets').should == {:controller => "timesheets", :action => "index"}
end
- it "generates params for #edit" do
- params_from(:get, '/timesheets/1/edit').should == {:controller => "timesheets", :action => "edit", :id => "1"}
- end
-
it "generates params for #edit given date" do
params_from(:get, '/timesheets/2009/4/13').should == {:controller => "timesheets", :action => "edit", :year => "2009", :month => "4", :day => "13"}
end

0 comments on commit 2da6c3a

Please sign in to comment.