Skip to content

Commit

Permalink
fixes generator templates failing with current rspec version
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Grankin committed Mar 31, 2009
1 parent ce9143f commit 7277cd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions generators/scaffold_resource/templates/rspec/routing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
route_for(:controller => "<%= table_name %>", :action => "new").should == "/<%= table_name %>/new"
end

it "should map { :controller => '<%= table_name %>', :action => 'show', :id => 1 } to /<%= table_name %>/1" do
route_for(:controller => "<%= table_name %>", :action => "show", :id => 1).should == "/<%= table_name %>/1"
it "should map { :controller => '<%= table_name %>', :action => 'show', :id => '1'} to /<%= table_name %>/1" do
route_for(:controller => "<%= table_name %>", :action => "show", :id => "1").should == "/<%= table_name %>/1"
end

it "should map { :controller => '<%= table_name %>', :action => 'edit', :id => 1 } to /<%= table_name %>/1<%= resource_edit_path %>" do
route_for(:controller => "<%= table_name %>", :action => "edit", :id => 1).should == "/<%= table_name %>/1<%= resource_edit_path %>"
it "should map { :controller => '<%= table_name %>', :action => 'edit', :id => '1' } to /<%= table_name %>/1<%= resource_edit_path %>" do
route_for(:controller => "<%= table_name %>", :action => "edit", :id => "1").should == "/<%= table_name %>/1<%= resource_edit_path %>"
end

it "should map { :controller => '<%= table_name %>', :action => 'update', :id => 1} to /<%= table_name %>/1" do
route_for(:controller => "<%= table_name %>", :action => "update", :id => 1).should == "/<%= table_name %>/1"
it "should map { :controller => '<%= table_name %>', :action => 'update', :id => '1' } to /<%= table_name %>/1" do
route_for(:controller => "<%= table_name %>", :action => "update", :id => "1").should == {:path => "/<%= table_name %>/1", :method => :put}
end

it "should map { :controller => '<%= table_name %>', :action => 'destroy', :id => 1} to /<%= table_name %>/1" do
route_for(:controller => "<%= table_name %>", :action => "destroy", :id => 1).should == "/<%= table_name %>/1"
it "should map { :controller => '<%= table_name %>', :action => 'destroy', :id => '1' } to /<%= table_name %>/1" do
route_for(:controller => "<%= table_name %>", :action => "destroy", :id => "1").should == {:path => "/<%= table_name %>/1", :method => :delete}
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<% end -%><% end %>
assigns[:<%= table_name %>] = [<%= file_name %>_98, <%= file_name %>_99]

template.stub!(:object_url).and_return(<%= file_name %>_path(@<%= file_name %>))
template.stub!(:object_url).and_return(<%= file_name %>_path(<%= file_name %>_99))
template.stub!(:new_object_url).and_return(new_<%= file_name %>_path)
template.stub!(:edit_object_url).and_return(edit_<%= file_name %>_path(@<%= file_name %>))
template.stub!(:edit_object_url).and_return(edit_<%= file_name %>_path(<%= file_name %>_99))
end

it "should render list of <%= table_name %>" do
Expand Down

0 comments on commit 7277cd8

Please sign in to comment.