aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-12-14 18:09:14 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-12-14 18:09:14 +0000
commit3486d5400745e1bab6ab0a64a6b9f12a614b09e3 (patch)
tree6bf8b6b09b09ebe58d968a59a901d7222226a9ac /railties/lib/rails_generator
parent78727dd8e226f16fd2446db0bcaf41e127ba9bc8 (diff)
downloadrails-3486d5400745e1bab6ab0a64a6b9f12a614b09e3.tar.gz
rails-3486d5400745e1bab6ab0a64a6b9f12a614b09e3.tar.bz2
rails-3486d5400745e1bab6ab0a64a6b9f12a614b09e3.zip
Fixed that functional tests generated for scaffolds should use fixture calls instead of hard-coded IDs (closes #10435) [boone]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb b/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb
index b5df88f3b1..2b1f6520d9 100644
--- a/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb
+++ b/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb
@@ -21,23 +21,23 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
end
def test_should_show_<%= file_name %>
- get :show, :id => 1
+ get :show, :id => <%= table_name %>(:one).id
assert_response :success
end
def test_should_get_edit
- get :edit, :id => 1
+ get :edit, :id => <%= table_name %>(:one).id
assert_response :success
end
def test_should_update_<%= file_name %>
- put :update, :id => 1, :<%= file_name %> => { }
+ put :update, :id => <%= table_name %>(:one).id, :<%= file_name %> => { }
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
end
def test_should_destroy_<%= file_name %>
assert_difference('<%= class_name %>.count', -1) do
- delete :destroy, :id => 1
+ delete :destroy, :id => <%= table_name %>(:one).id
end
assert_redirected_to <%= table_name %>_path