Project

General

Profile

« Previous | Next » 

Revision 27752930

Added by Kavita Gaikwad over 7 years ago

Fixes #17343 - set deep munge config off

deep_munge was introduced as a solution to keep
Rails secure by default which results in
'empty array becomes nil in params'.
Thats why, set deep_munge config off in application.rb.
Also, added changes which will cast param argument to string
while calling find_by_{string_type_attr} method on object.

View differences:

test/controllers/locations_controller_test.rb
assert_nil response.body['Parameter']
end
test 'should allow empty array as param value of array field while updating location' do
location = taxonomies(:location2)
location.update_attributes(:organization_ids => [taxonomies(:organization2).id])
saved_location = Location.find_by_id(location.id)
assert_equal saved_location.organization_ids.count, 1
put :update, { :id => location.id, :location => {:organization_ids => []}}, set_session_user
updated_location = Location.find_by_id(location.id)
assert_equal updated_location.organization_ids.count, 0
end
context 'wizard' do
test 'redirects to step 2 if unassigned hosts exist' do
host = FactoryGirl.create(:host)

Also available in: Unified diff