From 68608e331f88c3168cc3aa270ab5f1deea394c97 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 5 Jul 2006 23:48:27 +0000 Subject: Update scaffolding functional tests to use :id => people(:first) instead of :id => 1. Closes #5612. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4559 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../generators/components/scaffold/templates/functional_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails_generator/generators/components/scaffold') 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 3441b56670..31792767a3 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 @@ -39,7 +39,7 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase end def test_show<%= suffix %> - get :show<%= suffix %>, :id => 1 + get :show<%= suffix %>, :id => <%= plural_name %>(:first) assert_response :success assert_template 'show' @@ -69,7 +69,7 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase end def test_edit<%= suffix %> - get :edit<%= suffix %>, :id => 1 + get :edit<%= suffix %>, :id => <%= plural_name %>(:first) assert_response :success assert_template 'edit<%= suffix %>' @@ -79,13 +79,13 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase end def test_update<%= suffix %> - post :update<%= suffix %>, :id => 1 + post :update<%= suffix %>, :id => <%= plural_name %>(:first) assert_response :redirect assert_redirected_to :action => 'show<%= suffix %>', :id => 1 end def test_destroy<%= suffix %> - assert_not_nil <%= model_name %>.find(1) + assert_not_nil <%= model_name %>.find(<%= plural_name %>(:first)) post :destroy, :id => 1 assert_response :redirect -- cgit v1.2.3