Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions app/controllers/idv/address_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ def address_from_document

def success
idv_session.address_edited = address_edited?
idv_session.pii_from_doc = idv_session.pii_from_doc.merge(
address1: @address_form.address1,
address2: @address_form.address2,
city: @address_form.city,
state: @address_form.state,
zipcode: @address_form.zipcode,
)
idv_session.updated_user_address = @address_form.updated_user_address
redirect_to idv_verify_info_url
end
Expand Down
20 changes: 1 addition & 19 deletions spec/controllers/idv/address_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,6 @@
end.to change { subject.idv_session.address_edited }.from(nil).to eql(true)
end

it 'updates pii_from_doc in idv_session' do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should invert this test (assert that pii_from_doc is not modified?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little resistant because I am hopeful we can make pii_from_doc immutable here. That should reduce the risk of a regression and render this test unnecessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

expect do
put :update, params: params
end.to change { subject.idv_session.pii_from_doc }

expect(subject.idv_session.pii_from_doc).to eql(
pii_from_doc.merge(
{
'address1' => '1234 Main St',
'address2' => 'Apt B',
'city' => 'Beverly Hills',
'state' => 'CA',
'zipcode' => '90210',
},
),
)
end

it 'adds updated_user_data to idv_session' do
expect do
put :update, params: params
Expand Down Expand Up @@ -127,7 +109,7 @@
end
end

xit 'has the correct `address_edited` value when submitted twice with the same data' do
it 'has the correct `address_edited` value when submitted twice with the same data' do
put :update, params: params
expect(subject.idv_session.address_edited).to eq(true)
put :update, params: params
Expand Down