diff --git a/lib/inferno/apps/web/controllers/test_sessions/create.rb b/lib/inferno/apps/web/controllers/test_sessions/create.rb index d271f6403..1add2f170 100644 --- a/lib/inferno/apps/web/controllers/test_sessions/create.rb +++ b/lib/inferno/apps/web/controllers/test_sessions/create.rb @@ -10,9 +10,7 @@ class Create < Controller def handle(req, res) params = req.params.to_h - if req.body.string.present? && req.env['CONTENT_TYPE']&.include?('application/json') - params.merge!(JSON.parse(req.body.string).symbolize_keys) - end + params.merge!(JSON.parse(req.body.string).symbolize_keys) unless req.body.string.blank? session = repo.create(create_params(params)) diff --git a/spec/request_helper.rb b/spec/request_helper.rb index 00e3b1381..16410364c 100644 --- a/spec/request_helper.rb +++ b/spec/request_helper.rb @@ -11,10 +11,6 @@ def post_json(path, data) post path, data.to_json, 'CONTENT_TYPE' => 'application/json' end - def post_form_data(path, data) - post path, data, 'CONTENT_TYPE' => 'multipart/form-data' - end - def parsed_body JSON.parse(last_response.body) end diff --git a/spec/requests/test_sessions_spec.rb b/spec/requests/test_sessions_spec.rb index c0d4e7766..ff2024d28 100644 --- a/spec/requests/test_sessions_spec.rb +++ b/spec/requests/test_sessions_spec.rb @@ -52,18 +52,6 @@ expect(persisted_session.suite_options).to eq(expected_options) end end - - context 'with form data' do - it 'renders the test session json' do - post_form_data create_path, input - - expect(last_response.status).to eq(200) - - expect(parsed_body).to include(*response_fields) - expect(parsed_body['id']).to be_present - expect(parsed_body['test_suite_id']).to eq(test_suite_id) - end - end end context 'with invalid input' do