Skip to content

Commit

Permalink
use index_helper instead of table_name for controller paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaprima authored and dchelimsky committed Feb 5, 2011
1 parent 1a0508a commit 057000c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/generators/rspec/integration/templates/request_spec.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rspec/scaffold/templates/controller_spec.rb
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rspec/scaffold/templates/edit_spec.rb
Expand Up @@ -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 -%>
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rspec/scaffold/templates/new_spec.rb
Expand Up @@ -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 -%>
Expand Down

0 comments on commit 057000c

Please sign in to comment.