We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm seeing behavior where using be_successful hangs (rather than fails) when the request status is not a 200.
be_successful
hangs:
get "/items/#{id}" expect(response).to be_successful
Fails right away:
get "/items/#{id}" expect(response).to have_http_status(:ok)
with:
Failure/Error: expect(response).to have_http_status(:ok) expected the response to have status code :ok (200) but it was :forbidden (403)
Using:
rspec-rails (5.1.1) rspec-core (3.11.0) rails (7.0.2.3)
The text was updated successfully, but these errors were encountered:
Shouldn't it be expect(response).to be_ok?
expect(response).to be_ok
Would expect(response.successful?).to be true hang, too?
expect(response.successful?).to be true
Sorry, something went wrong.
@pirj I think that be_successful is true for any 2xx based response. (e.g. :ok, :created, :no_content)
When I use expect(response.successful?).to be true it fails right away as expected.
No branches or pull requests
I'm seeing behavior where using
be_successful
hangs (rather than fails) when the request status is not a 200.hangs:
Fails right away:
with:
Using:
The text was updated successfully, but these errors were encountered: