Skip to content

Commit

Permalink
Merge pull request #19395 from department-of-veterans-affairs/dev-sup…
Browse files Browse the repository at this point in the history
…port/APPEALS-24121

APPEALS-24121 - Fix flaky/skipped tests in feature/api/v2/appeals_spe…
  • Loading branch information
craigrva authored Sep 7, 2023
2 parents efe83c1 + 9ea20fe commit 17ec2bd
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions spec/feature/api/v2/appeals_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,28 @@
expect(ApiView.count).to eq(0)
end

it "returns 404 if veteran with that SSN isn't found", skip: "I believe this just returns an empty array" do
headers = {
"ssn": "444444444",
"Authorization": "Token token=#{api_key.key_string}"
}
context "ssn not found" do
before do
allow_any_instance_of(Fakes::BGSService).to receive(:fetch_file_number_by_ssn) do |_bgs, _ssn|
nil
end
end

get "/api/v2/appeals", headers: headers
it "returns 404 if veteran with that SSN isn't found" do
headers = {
"ssn": "444444444",
"Authorization": "Token token=#{api_key.key_string}"
}

expect(response.code).to eq("404")
get "/api/v2/appeals", headers: headers

json = JSON.parse(response.body)
expect(json["errors"].length).to eq(1)
expect(json["errors"].first["title"]).to eq("Veteran not found")
expect(response.code).to eq("404")

expect(ApiView.count).to eq(1)
json = JSON.parse(response.body)
expect(json["errors"].length).to eq(1)
expect(json["errors"].first["title"]).to eq("Veteran not found")
expect(ApiView.count).to eq(0)
end
end

it "records source if sent" do
Expand Down

0 comments on commit 17ec2bd

Please sign in to comment.