diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-03-12 20:10:40 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-03-13 11:23:14 -0300 |
commit | ac8469d233821899283bcb7e6b0cd8d4203ffb35 (patch) | |
tree | 02d3e6b0d4adc450413b7504b81a5bcc9644a14a /railties/lib/rails/generators/test_unit/scaffold/templates | |
parent | 5bed0e5cc0ae85975352808022201cf7431684e5 (diff) | |
download | rails-ac8469d233821899283bcb7e6b0cd8d4203ffb35.tar.gz rails-ac8469d233821899283bcb7e6b0cd8d4203ffb35.tar.bz2 rails-ac8469d233821899283bcb7e6b0cd8d4203ffb35.zip |
Use the attributes hash explicitly
Diffstat (limited to 'railties/lib/rails/generators/test_unit/scaffold/templates')
-rw-r--r-- | railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb | 5 |
1 files changed, 2 insertions, 3 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 e9fe27e504..19894443d5 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 @@ -4,7 +4,6 @@ require 'test_helper' class <%= controller_class_name %>ControllerTest < ActionController::TestCase setup do @<%= singular_table_name %> = <%= table_name %>(:one) - @valid_attributes = @<%= singular_table_name %>.attributes.slice(<%= accessible_attributes %>) end test "should get index" do @@ -20,7 +19,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase test "should create <%= singular_table_name %>" do assert_difference('<%= class_name %>.count') do - post :create, <%= key_value singular_table_name, "@valid_attributes" %> + post :create, <%= resource_attributes %> end assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>)) @@ -37,7 +36,7 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase end test "should update <%= singular_table_name %>" do - put :update, <%= key_value :id, "@#{singular_table_name}" %>, <%= key_value singular_table_name, "@valid_attributes" %> + put :update, <%= key_value :id, "@#{singular_table_name}" %>, <%= resource_attributes %> assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>)) end |