summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/functional/custom_field_enumerations_controller_test.rb36
1 files changed, 28 insertions, 8 deletions
diff --git a/test/functional/custom_field_enumerations_controller_test.rb b/test/functional/custom_field_enumerations_controller_test.rb
index 9ead8f4b2..93a1dbc64 100644
--- a/test/functional/custom_field_enumerations_controller_test.rb
+++ b/test/functional/custom_field_enumerations_controller_test.rb
@@ -32,9 +32,12 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
end
def test_index
- get :index, :params => {
+ get(
+ :index,
+ :params => {
:custom_field_id => @field.id
}
+ )
assert_response :success
assert_select 'ul#custom_field_enumerations' do
@@ -44,12 +47,15 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
def test_create
assert_difference 'CustomFieldEnumeration.count' do
- post :create, :params => {
+ post(
+ :create,
+ :params => {
:custom_field_id => @field.id,
:custom_field_enumeration => {
:name => 'Baz'
}
}
+ )
assert_redirected_to "/custom_fields/#{@field.id}/enumerations"
end
@@ -62,19 +68,24 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
def test_create_xhr
assert_difference 'CustomFieldEnumeration.count' do
- post :create, :params => {
+ 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, :params => {
+ put(
+ :update_each,
+ :params => {
:custom_field_id => @field.id,
:custom_field_enumerations => {
@bar.id.to_s => {
@@ -87,9 +98,9 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
:name => "Foo",
:active => "0"
}
-
}
}
+ )
assert_response 302
@bar.reload
@@ -105,10 +116,13 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
def test_destroy
assert_difference 'CustomFieldEnumeration.count', -1 do
- delete :destroy, :params => {
+ delete(
+ :destroy,
+ :params => {
:custom_field_id => @field.id,
:id => @foo.id
}
+ )
assert_redirected_to "/custom_fields/#{@field.id}/enumerations"
end
@@ -123,10 +137,13 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
group.save!
assert_no_difference 'CustomFieldEnumeration.count' do
- delete :destroy, :params => {
+ delete(
+ :destroy,
+ :params => {
:custom_field_id => @field.id,
:id => @foo.id
}
+ )
assert_response :success
assert_select 'select[name=?]', 'reassign_to_id'
@@ -139,11 +156,14 @@ class CustomFieldEnumerationsControllerTest < Redmine::ControllerTest
group.save!
assert_difference 'CustomFieldEnumeration.count', -1 do
- delete :destroy, :params => {
+ delete(
+ :destroy,
+ :params => {
:custom_field_id => @field.id,
:id => @foo.id,
:reassign_to_id => @bar.id
}
+ )
assert_response 302
end