Permalink
Browse files

use index_helper instead of table_name for controller paths

  • Loading branch information...
1 parent 1a0508a commit 057000cecf2fa3508d2aa922a102aec19ee4982c @rezaprima rezaprima committed with dchelimsky Jan 24, 2011
@@ -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
@@ -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
@@ -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 -%>
@@ -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 -%>

0 comments on commit 057000c

Please sign in to comment.