aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/test_unit/scaffold/templates
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-04-10 12:27:26 +0800
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-04-10 16:47:50 +0800
commit63cd92f9f346acefca1ad014873c971837843cdb (patch)
tree23be83a25e191359502ae7b95e83deee97ba93fe /railties/lib/rails/generators/test_unit/scaffold/templates
parentc0efc4009adb870ee23e93d46ac374f772d8cb4f (diff)
downloadrails-63cd92f9f346acefca1ad014873c971837843cdb.tar.gz
rails-63cd92f9f346acefca1ad014873c971837843cdb.tar.bz2
rails-63cd92f9f346acefca1ad014873c971837843cdb.zip
Rails will now generate Ruby 1.9 style hash when running scaffold_controller generator on Ruby 1.9.x
The new hash syntax of Ruby 1.9 looks more superior, so we decide to switch to it in the places that appropriate. This patch has been requested by DHH.
Diffstat (limited to 'railties/lib/rails/generators/test_unit/scaffold/templates')
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
index 964d59d84c..01fe6dda7a 100644
--- a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
+++ b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
@@ -19,30 +19,30 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
test "should create <%= singular_table_name %>" do
assert_difference('<%= class_name %>.count') do
- post :create, :<%= singular_table_name %> => @<%= singular_table_name %>.attributes
+ post :create, <%= key_value singular_table_name, "@#{singular_table_name}.attributes" %>
end
assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>))
end
test "should show <%= singular_table_name %>" do
- get :show, :id => @<%= singular_table_name %>.to_param
+ get :show, <%= key_value :id, "@#{singular_table_name}.to_param" %>
assert_response :success
end
test "should get edit" do
- get :edit, :id => @<%= singular_table_name %>.to_param
+ get :edit, <%= key_value :id, "@#{singular_table_name}.to_param" %>
assert_response :success
end
test "should update <%= singular_table_name %>" do
- put :update, :id => @<%= singular_table_name %>.to_param, :<%= singular_table_name %> => @<%= singular_table_name %>.attributes
+ put :update, <%= key_value :id, "@#{singular_table_name}.to_param" %>, <%= key_value singular_table_name, "@#{singular_table_name}.attributes" %>
assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>))
end
test "should destroy <%= singular_table_name %>" do
assert_difference('<%= class_name %>.count', -1) do
- delete :destroy, :id => @<%= singular_table_name %>.to_param
+ delete :destroy, <%= key_value :id, "@#{singular_table_name}.to_param" %>
end
assert_redirected_to <%= index_helper %>_path