diff --git a/spec/features/backend_error_flows_spec.rb b/spec/features/backend_error_flows_spec.rb index d3b0bb14f..79d0e2392 100644 --- a/spec/features/backend_error_flows_spec.rb +++ b/spec/features/backend_error_flows_spec.rb @@ -60,49 +60,49 @@ DownloadHelpers.clear_downloads end - # context "When VBMS returns an error" do - # before do - # allow(Fakes::VBMSService).to receive(:v2_fetch_documents_for).and_raise(VBMS::ClientError.new("vbms returned an error")) - # allow(Fakes::VVAService).to receive(:v2_fetch_documents_for).and_return(documents) - # end - - # scenario "Download with VBMS connection error" do - # perform_enqueued_jobs do - # visit "/" - # fill_in "Search for a Veteran ID number below to get started.", with: veteran_id - # click_button "Search" - - # expect(page).to have_css ".usa-alert-heading", text: "We could not complete the search for this Veteran ID" - # expect(page).to have_content Caseflow::DocumentTypes::TYPES[documents[0].type_id] - - # click_link "Back to eFolder Express" - - # expect(page).to have_current_path("/") - # end - # end - # end - - # context "When VVA returns an error" do - # before do - # allow(Fakes::VVAService).to receive(:v2_fetch_documents_for).and_raise(VVA::ClientError.new("vva returned an error")) - # allow(Fakes::VBMSService).to receive(:v2_fetch_documents_for).and_return(documents) - # end - - # scenario "Download with VVA connection error" do - # perform_enqueued_jobs do - # visit "/" - # fill_in "Search for a Veteran ID number below to get started.", with: veteran_id - # click_button "Search" - - # expect(page).to have_css ".usa-alert-heading", text: "We are having trouble connecting to VVA" - # expect(page).to have_content Caseflow::DocumentTypes::TYPES[documents[0].type_id] - - # click_link "Back to eFolder Express" - - # expect(page).to have_current_path("/") - # end - # end - # end + context "When VBMS returns an error" do + before do + allow(Fakes::VBMSService).to receive(:v2_fetch_documents_for).and_raise(VBMS::ClientError.new("vbms returned an error")) + allow(Fakes::VVAService).to receive(:v2_fetch_documents_for).and_return(documents) + end + + scenario "Download with VBMS connection error" do + perform_enqueued_jobs do + visit "/" + fill_in "Search for a Veteran ID number below to get started.", with: veteran_id + click_button "Search" + + expect(page).to have_css ".usa-alert-heading", text: "We could not complete the search for this Veteran ID" + expect(page).to have_content Caseflow::DocumentTypes::TYPES[documents[0].type_id] + + click_link "Back to eFolder Express" + + expect(page).to have_current_path("/") + end + end + end + + context "When VVA returns an error" do + before do + allow(Fakes::VVAService).to receive(:v2_fetch_documents_for).and_raise(VVA::ClientError.new("vva returned an error")) + allow(Fakes::VBMSService).to receive(:v2_fetch_documents_for).and_return(documents) + end + + scenario "Download with VVA connection error" do + perform_enqueued_jobs do + visit "/" + fill_in "Search for a Veteran ID number below to get started.", with: veteran_id + click_button "Search" + + expect(page).to have_css ".usa-alert-heading", text: "We are having trouble connecting to VVA" + expect(page).to have_content Caseflow::DocumentTypes::TYPES[documents[0].type_id] + + click_link "Back to eFolder Express" + + expect(page).to have_current_path("/") + end + end + end context "When at least one document fails" do before do