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
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
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 => {
:name => "Foo",
:active => "0"
}
-
}
}
+ )
assert_response 302
@bar.reload
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
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'
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