Skip to content
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

APPEALS-24121 - Fix flaky/skipped tests in feature/api/v2/appeals_spe… #19395

Merged
merged 1 commit into from
Sep 7, 2023
Merged
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
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
Loading