-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API-39286-rename-poa-pdf #18259
Merged
Merged
API-39286-rename-poa-pdf #18259
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e4a356c
API-39286-rename-poa-pdf
rockwellwindsor-va b2a6592
Fixes for missed scenario for L190 in v1
rockwellwindsor-va 1eabce2
Reworking to pass a flag from the 'put' action the v1 poa controller …
rockwellwindsor-va 913081e
Merge branch 'master' into API-39286-rename-poa-pdf
rockwellwindsor-va 087cba0
WIP
rockwellwindsor-va 1d3ba3f
Merge branch 'master' into API-39286-rename-poa-pdf
rockwellwindsor-va 9fc87b8
Updates to handle setting file name when sent from the PUT (upload) f…
rockwellwindsor-va dcc23a3
Update modules/claims_api/spec/lib/claims_api/bd_spec.rb
rockwellwindsor-va 854875c
Merge branch 'master' into API-39286-rename-poa-pdf
rockwellwindsor-va c22f486
Merge branch 'master' into API-39286-rename-poa-pdf
rockwellwindsor-va File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
end | ||
|
||
it 'uploads an attachment to BD for L023' do | ||
result = subject.send(:generate_upload_body, claim:, doc_type: 'L023', pdf_path:, | ||
result = subject.send(:generate_upload_body, claim:, doc_type: 'L023', pdf_path:, action: 'post', | ||
original_filename: 'stuff.pdf') | ||
js = JSON.parse(result[:parameters].read) | ||
expect(js['data']['docType']).to eq 'L023' | ||
|
@@ -42,7 +42,7 @@ | |
|
||
it 'uploads an attachment to BD for L122' do | ||
result = subject.send(:generate_upload_body, claim:, doc_type: 'L122', original_filename: '21-526EZ.pdf', | ||
pdf_path:) | ||
pdf_path:, action: 'post') | ||
js = JSON.parse(result[:parameters].read) | ||
expect(js['data']['docType']).to eq 'L122' | ||
expect(js['data']['claimId']).to eq claim.evss_id | ||
|
@@ -87,7 +87,7 @@ | |
context 'when the doctype is L190' do | ||
let(:pdf_path) { 'modules/claims_api/spec/fixtures/21-22/signed_filled_final.pdf' } | ||
let(:json_body) do | ||
res = subject.send(:generate_upload_body, claim: power_of_attorney, pdf_path:, | ||
res = subject.send(:generate_upload_body, claim: power_of_attorney, pdf_path:, action: 'post', | ||
doc_type: 'L190') | ||
temp_io = res[:parameters].instance_variable_get(:@io).path | ||
temp_io_contents = File.read(temp_io) | ||
|
@@ -112,29 +112,63 @@ | |
end | ||
|
||
context 'when the doctype is L075' do | ||
let(:pdf_path) { 'modules/claims_api/spec/fixtures/21-22A/signed_filled_final.pdf' } | ||
let(:json_body) do | ||
res = subject.send(:generate_upload_body, claim: power_of_attorney, pdf_path:, | ||
doc_type: 'L075') | ||
temp_io = res[:parameters].instance_variable_get(:@io).path | ||
temp_io_contents = File.read(temp_io) | ||
JSON.parse(temp_io_contents) | ||
end | ||
|
||
it 'the systemName is Lighthouse' do | ||
expect(json_body['data']['systemName']).to eq('Lighthouse') | ||
end | ||
|
||
it 'the docType is L075' do | ||
expect(json_body['data']['docType']).to eq('L075') | ||
context 'when the api version is v2' do | ||
let(:pdf_path) { 'modules/claims_api/spec/fixtures/21-22A/signed_filled_final.pdf' } | ||
let(:json_body) do | ||
res = subject.send(:generate_upload_body, claim: power_of_attorney, pdf_path:, action: 'post', | ||
doc_type: 'L075') | ||
temp_io = res[:parameters].instance_variable_get(:@io).path | ||
temp_io_contents = File.read(temp_io) | ||
JSON.parse(temp_io_contents) | ||
end | ||
|
||
it 'the systemName is Lighthouse' do | ||
expect(json_body['data']['systemName']).to eq('Lighthouse') | ||
end | ||
|
||
it 'the docType is L075' do | ||
expect(json_body['data']['docType']).to eq('L075') | ||
end | ||
|
||
it 'the fileName ends in 21-22a.pdf' do | ||
expect(json_body['data']['fileName']).to end_with('21-22a.pdf') | ||
end | ||
|
||
it 'the claimId is not present' do | ||
expect(json_body['data']).not_to have_key('claimId') | ||
end | ||
end | ||
|
||
it 'the fileName ends in 21-22a.pdf' do | ||
expect(json_body['data']['fileName']).to end_with('21-22a.pdf') | ||
end | ||
|
||
it 'the claimId is not present' do | ||
expect(json_body['data']).not_to have_key('claimId') | ||
context 'when the api version is v1' do | ||
context 'the doc type is 21-22a' do | ||
let(:pdf_path) { 'modules/claims_api/spec/fixtures/21-22A/signed_filled_final.pdf' } | ||
let(:json_body) do | ||
res = subject.send(:generate_upload_body, claim: power_of_attorney, pdf_path:, action: 'put', | ||
doc_type: 'L075') | ||
temp_io = res[:parameters].instance_variable_get(:@io).path | ||
temp_io_contents = File.read(temp_io) | ||
JSON.parse(temp_io_contents) | ||
end | ||
|
||
it 'the fileName ends in representative.pdf' do | ||
expect(json_body['data']['fileName']).to end_with('_representative.pdf') | ||
end | ||
end | ||
|
||
context 'the doc type is 21-22' do | ||
let(:pdf_path) { 'modules/claims_api/spec/fixtures/21-22/signed_filled_final.pdf' } | ||
let(:json_body) do | ||
res = subject.send(:generate_upload_body, claim: power_of_attorney, pdf_path:, action: 'put', | ||
doc_type: 'L190') | ||
temp_io = res[:parameters].instance_variable_get(:@io).path | ||
temp_io_contents = File.read(temp_io) | ||
JSON.parse(temp_io_contents) | ||
end | ||
|
||
it 'the fileName ends in representative.pdf' do | ||
expect(json_body['data']['fileName']).to end_with('_representative.pdf') | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not entirely sure this second test is needed since this scenario shouldn't happen. Wanted to include it just to be safe. If anyone feels strongly about removing it I am open to that but wanted to error on the side of playing it safe and making sure this would be handled. |
||
end | ||
end | ||
end | ||
|
@@ -162,7 +196,7 @@ | |
describe '#generate_upload_body' do | ||
it 'uploads an attachment to BD for L705' do | ||
result = subject.send(:generate_upload_body, claim: ews, doc_type: 'L705', original_filename: '5103.pdf', | ||
pdf_path:) | ||
pdf_path:, action: 'post') | ||
js = JSON.parse(result[:parameters].read) | ||
expect(js['data']['docType']).to eq 'L705' | ||
expect(js['data']['claimId']).to eq ews.claim_id | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has approx 12 statements - TooManyStatements