diff --git a/lib/generators/rspec/integration/templates/request_spec.rb b/lib/generators/rspec/integration/templates/request_spec.rb index 9c2930b17e..4e83e74c36 100644 --- a/lib/generators/rspec/integration/templates/request_spec.rb +++ b/lib/generators/rspec/integration/templates/request_spec.rb @@ -4,10 +4,10 @@ describe "GET /<%= table_name %>" do it "works! (now write some real specs)" do <% if webrat? -%> - visit <%= table_name %>_path + visit <%= index_helper %>_path <% else -%> # Run the generator again with the --webrat flag if you want to use webrat methods/matchers - get <%= table_name %>_path + get <%= index_helper %>_path <% end -%> response.status.should be(200) end diff --git a/lib/generators/rspec/scaffold/templates/controller_spec.rb b/lib/generators/rspec/scaffold/templates/controller_spec.rb index 6cddbda153..355e3fd135 100755 --- a/lib/generators/rspec/scaffold/templates/controller_spec.rb +++ b/lib/generators/rspec/scaffold/templates/controller_spec.rb @@ -120,7 +120,7 @@ def <%= mock_file_name %>(stubs={}) it "redirects to the <%= table_name %> list" do <%= stub orm_class.find(class_name) %> { <%= mock_file_name %> } delete :destroy, :id => "1" - response.should redirect_to(<%= table_name %>_url) + response.should redirect_to(<%= index_helper %>_url) end end diff --git a/lib/generators/rspec/scaffold/templates/edit_spec.rb b/lib/generators/rspec/scaffold/templates/edit_spec.rb index 49259754f2..ac3dabebe3 100644 --- a/lib/generators/rspec/scaffold/templates/edit_spec.rb +++ b/lib/generators/rspec/scaffold/templates/edit_spec.rb @@ -21,7 +21,7 @@ end <% else -%> # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => <%= file_name %>_path(@<%= file_name %>), :method => "post" do + assert_select "form", :action => <%= index_helper %>_path(@<%= file_name %>), :method => "post" do <% for attribute in output_attributes -%> assert_select "<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>", :name => "<%= file_name %>[<%= attribute.name %>]" <% end -%> diff --git a/lib/generators/rspec/scaffold/templates/new_spec.rb b/lib/generators/rspec/scaffold/templates/new_spec.rb index 2bb51b50c6..48d0bb9e3e 100644 --- a/lib/generators/rspec/scaffold/templates/new_spec.rb +++ b/lib/generators/rspec/scaffold/templates/new_spec.rb @@ -20,7 +20,7 @@ end <% else -%> # Run the generator again with the --webrat flag if you want to use webrat matchers - assert_select "form", :action => <%= table_name %>_path, :method => "post" do + assert_select "form", :action => <%= index_helper %>_path, :method => "post" do <% for attribute in output_attributes -%> assert_select "<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>", :name => "<%= file_name %>[<%= attribute.name %>]" <% end -%>