Skip to content

Commit

Permalink
[ARP] handle camel params in ARP IPF controller
Browse files Browse the repository at this point in the history
  • Loading branch information
nihil2501 committed Feb 6, 2025
1 parent e406275 commit e3917de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class InProgressFormsController < ApplicationController
def update
form = find_form || build_form
form.update!(
form_data: params[:form_data],
form_data: params[:formData],
metadata: params[:metadata]
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
:in_progress_form,
user_uuid: representative_user.uuid,
form_data: { field: 'value' },
form_id:
form_id:,
metadata: {
version: 1,
returnUrl: 'foo.com'
}
)

get("/accredited_representative_portal/v0/in_progress_forms/#{form_id}")
Expand All @@ -33,14 +37,7 @@
},
'metadata' => {
'version' => 1,
'return_url' => 'foo.com',
'submission' => {
'status' => false,
'error_message' => false,
'id' => false,
'timestamp' => false,
'has_attempted_submit' => false
},
'returnUrl' => 'foo.com',
'createdAt' => 1_646_370_367,
'expiresAt' => 1_651_554_367,
'lastUpdated' => 1_646_370_367,
Expand All @@ -57,7 +54,7 @@

put(
"/accredited_representative_portal/v0/in_progress_forms/#{form_id}",
params: { 'form_data' => { another_field: 'foo' } }.to_json,
params: { 'formData' => { anotherField: 'foo' } }.to_json,
headers:
)

Expand Down Expand Up @@ -85,7 +82,7 @@
expect(parsed_response).to eq(
{
'formData' => {
'another_field' => 'foo'
'anotherField' => 'foo'
},
'metadata' => {
'createdAt' => 1_646_456_767,
Expand All @@ -101,7 +98,7 @@

put(
"/accredited_representative_portal/v0/in_progress_forms/#{form_id}",
params: { 'form_data' => { another_field: 'foo', sample_field: 'sample' } }.to_json,
params: { 'formData' => { anotherField: 'foo', sampleField: 'sample' } }.to_json,
headers:
)

Expand Down Expand Up @@ -129,8 +126,8 @@
expect(parsed_response).to eq(
{
'formData' => {
'another_field' => 'foo',
'sample_field' => 'sample'
'anotherField' => 'foo',
'sampleField' => 'sample'
},
'metadata' => {
'createdAt' => 1_646_456_767,
Expand Down

0 comments on commit e3917de

Please sign in to comment.