DEV: Improve error message when test fails (#25067)

Why this change?

The two tests being updated in question has been flaky on CI. However,
when using `be_forbidden`, the error message does not indicate what the
actual response code was making it hard for us to debug.

What does this change do?

Assert for the exact response status code we are expecting.
This commit is contained in:
Alan Guo Xiang Tan 2023-12-29 12:44:41 +08:00 committed by GitHub
parent ce57969016
commit 6e8c2bb4ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ RSpec.describe FinishInstallationController do
it "doesn't allow access" do
get "/finish-installation"
expect(response).to be_forbidden
expect(response.status).to eq(403)
end
end
@ -27,7 +27,7 @@ RSpec.describe FinishInstallationController do
it "doesn't allow access" do
get "/finish-installation/register"
expect(response).to be_forbidden
expect(response.status).to eq(403)
end
end