diff options
Diffstat (limited to 'test/functional/custom_field_enumerations_controller_test.rb')
-rw-r--r-- | test/functional/custom_field_enumerations_controller_test.rb | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/test/functional/custom_field_enumerations_controller_test.rb b/test/functional/custom_field_enumerations_controller_test.rb index 539600125..913517ae1 100644 --- a/test/functional/custom_field_enumerations_controller_test.rb +++ b/test/functional/custom_field_enumerations_controller_test.rb @@ -30,7 +30,9 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest end def test_index - get :index, :custom_field_id => @field.id + get :index, :params => { + :custom_field_id => @field.id + } assert_response :success assert_select 'ul#custom_field_enumerations' do @@ -40,7 +42,12 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest def test_create assert_difference 'CustomFieldEnumeration.count' do - post :create, :custom_field_id => @field.id, :custom_field_enumeration => { :name => 'Baz' } + post :create, :params => { + :custom_field_id => @field.id, + :custom_field_enumeration => { + :name => 'Baz' + } + } assert_redirected_to "/custom_fields/#{@field.id}/enumerations" end @@ -53,16 +60,34 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest def test_create_xhr assert_difference 'CustomFieldEnumeration.count' do - xhr :post, :create, :custom_field_id => @field.id, :custom_field_enumeration => { :name => 'Baz' } + post :create, :params => { + :custom_field_id => @field.id, + :custom_field_enumeration => { + :name => 'Baz' + } + }, + :xhr => true assert_response :success end end def test_update_each - put :update_each, :custom_field_id => @field.id, :custom_field_enumerations => { - @bar.id => {:position => "1", :name => "Baz", :active => "1"}, - @foo.id => {:position => "2", :name => "Foo", :active => "0"} - } + put :update_each, :params => { + :custom_field_id => @field.id, + :custom_field_enumerations => { + @bar.id => { + :position => "1", + :name => "Baz", + :active => "1" + }, + @foo.id => { + :position => "2", + :name => "Foo", + :active => "0" + } + + } + } assert_response 302 @bar.reload @@ -78,7 +103,10 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest def test_destroy assert_difference 'CustomFieldEnumeration.count', -1 do - delete :destroy, :custom_field_id => @field.id, :id => @foo.id + delete :destroy, :params => { + :custom_field_id => @field.id, + :id => @foo.id + } assert_redirected_to "/custom_fields/#{@field.id}/enumerations" end @@ -93,7 +121,10 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest group.save! assert_no_difference 'CustomFieldEnumeration.count' do - delete :destroy, :custom_field_id => @field.id, :id => @foo.id + delete :destroy, :params => { + :custom_field_id => @field.id, + :id => @foo.id + } assert_response :success assert_select 'select[name=?]', 'reassign_to_id' @@ -106,7 +137,11 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest group.save! assert_difference 'CustomFieldEnumeration.count', -1 do - delete :destroy, :custom_field_id => @field.id, :id => @foo.id, :reassign_to_id => @bar.id + delete :destroy, :params => { + :custom_field_id => @field.id, + :id => @foo.id, + :reassign_to_id => @bar.id + } assert_response 302 end |