Skip to content

Commit

Permalink
Merge branch 'generatorfixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason T Johnson committed May 26, 2008
2 parents 95a0e33 + a0a09e1 commit 00bd10c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README
Expand Up @@ -147,8 +147,8 @@ alter to suit. There are additional security minutae in @notes/README-Tradeoffs@
* Add these familiar login URLs to your @config/routes.rb@ if you like:

map.signup '/signup', :controller => 'users', :action => 'new' @
map.login '/login', :controller => 'session', :action => 'new' @
map.logout '/logout', :controller => 'session', :action => 'destroy' @
map.login '/login', :controller => 'sessions', :action => 'new' @
map.logout '/logout', :controller => 'sessions', :action => 'destroy' @

* With @--include-activation@, also add to your @config/routes.rb@:

Expand Down
Expand Up @@ -101,26 +101,26 @@ def do_destroy

describe <%= controller_class_name %>Controller do
describe "route generation" do
it "should route {:controller => '<%= controller_file_path %>', :action => 'new'} to /<%= controller_file_path %>/new" do
route_for(:controller => '<%= controller_file_path %>', :action => 'new').should == "/<%= controller_file_path %>/new"
it "should route {:controller => '<%= controller_file_path %>', :action => 'new'} to /login" do
route_for(:controller => '<%= controller_file_path %>', :action => 'new').should == "/login"
end
it "should route {:controller => '<%= controller_file_path %>', :action => 'create'} to /<%= controller_file_path %>" do
route_for(:controller => '<%= controller_file_path %>', :action => 'create').should == "/<%= controller_file_path %>"
end
it "should route {:controller => '<%= controller_file_path %>', :action => 'destroy'} to /<%= controller_file_path %>" do
route_for(:controller => '<%= controller_file_path %>', :action => 'destroy').should == "/<%= controller_file_path %>/destroy"
it "should route {:controller => '<%= controller_file_path %>', :action => 'destroy'} to /logout" do
route_for(:controller => '<%= controller_file_path %>', :action => 'destroy').should == "/logout"
end
end

describe "route recognition" do
it "should generate params {:controller => '<%= controller_file_path %>', :action => 'new'} from GET /<%= controller_file_path %>" do
params_from(:get, '/<%= controller_file_path %>/new').should == {:controller => '<%= controller_file_path %>', :action => 'new'}
it "should generate params {:controller => '<%= controller_file_path %>', :action => 'new'} from GET /login" do
params_from(:get, '/login').should == {:controller => '<%= controller_file_path %>', :action => 'new'}
end
it "should generate params {:controller => '<%= controller_file_path %>', :action => 'create'} from POST /<%= controller_file_path %>" do
params_from(:post, '/<%= controller_file_path %>').should == {:controller => '<%= controller_file_path %>', :action => 'create'}
end
it "should generate params {:controller => '<%= controller_file_path %>', :action => 'destroy'} from DELETE /<%= controller_file_path %>" do
params_from(:delete, '/<%= controller_file_path %>').should == {:controller => '<%= controller_file_path %>', :action => 'destroy'}
params_from(:delete, '/logout').should == {:controller => '<%= controller_file_path %>', :action => 'destroy'}
end
end

Expand Down
Expand Up @@ -100,8 +100,8 @@ def create_<%= file_name %>(options = {})
route_for(:controller => '<%= model_controller_file_path %>', :action => 'index').should == "/<%= model_controller_file_path %>"
end

it "should route {:controller => '<%= model_controller_file_path %>', :action => 'new'} to /<%= model_controller_file_path %>/new" do
route_for(:controller => '<%= model_controller_file_path %>', :action => 'new').should == "/<%= model_controller_file_path %>/new"
it "should route {:controller => '<%= model_controller_file_path %>', :action => 'new'} to /signup" do
route_for(:controller => '<%= model_controller_file_path %>', :action => 'new').should == "/signup"
end

it "should route {:controller => '<%= model_controller_file_path %>', :action => 'create'} to /<%= model_controller_file_path %>" do
Expand Down

0 comments on commit 00bd10c

Please sign in to comment.