diff options
Diffstat (limited to 'railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb')
-rw-r--r-- | railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb | 28 |
1 files changed, 14 insertions, 14 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 cbd89d1b4c..c1b934a5d3 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 @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../test_helper' +require File.dirname(__FILE__) + '<%= "/.." * controller_class_nesting_depth %>/../test_helper' require '<%= controller_file_path %>_controller' # Re-raise errors caught by the controller. @@ -15,66 +15,66 @@ class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase <% for action in unscaffolded_actions -%> def test_<%= action %> - process :<%= action %> + get :<%= action %> assert_rendered_file '<%= action %>' end <% end -%> <% unless suffix -%> def test_index - process :index + get :index assert_rendered_file 'list' end <% end -%> def test_list<%= suffix %> - process :list<%= suffix %> + get :list<%= suffix %> assert_rendered_file 'list<%= suffix %>' assert_template_has '<%= plural_name %>' end def test_show<%= suffix %> - process :show<%= suffix %>, 'id' => 1 + get :show<%= suffix %>, 'id' => 1 assert_rendered_file 'show' assert_template_has '<%= singular_name %>' assert_valid_record '<%= singular_name %>' end def test_new<%= suffix %> - process :new<%= suffix %> + get :new<%= suffix %> assert_rendered_file 'new<%= suffix %>' assert_template_has '<%= singular_name %>' end def test_create - num_<%= plural_name %> = <%= class_name %>.find_all.size + num_<%= plural_name %> = <%= model_name %>.find_all.size - process :create<%= suffix %>, '<%= singular_name %>' => { } + post :create<%= suffix %>, '<%= singular_name %>' => { } assert_redirected_to :action => 'list<%= suffix %>' - assert_equal num_<%= plural_name %> + 1, <%= class_name %>.find_all.size + assert_equal num_<%= plural_name %> + 1, <%= model_name %>.find_all.size end def test_edit<%= suffix %> - process :edit<%= suffix %>, 'id' => 1 + get :edit<%= suffix %>, 'id' => 1 assert_rendered_file 'edit<%= suffix %>' assert_template_has '<%= singular_name %>' assert_valid_record '<%= singular_name %>' end def test_update<%= suffix %> - process :update<%= suffix %>, '<%= singular_name %>' => { 'id' => 1 } + post :update<%= suffix %>, 'id' => 1 assert_redirected_to :action => 'show<%= suffix %>', :id => 1 end def test_destroy<%= suffix %> - assert_not_nil <%= class_name %>.find(1) + assert_not_nil <%= model_name %>.find(1) - process :destroy, 'id' => 1 + post :destroy, 'id' => 1 assert_redirected_to :action => 'list<%= suffix %>' assert_raise(ActiveRecord::RecordNotFound) { - <%= singular_name %> = <%= class_name %>.find(1) + <%= singular_name %> = <%= model_name %>.find(1) } end end |