-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
rspec/rspec-rails
#2771Labels
bugSomething isn't workingSomething isn't working
Description
last_response addition doesn't work with the have_http_status
matcher since it's a Rails/Matcher that acts on ActionDispatch::TestResponse
Although, I think enforcing the style be_status
should describe an offense like
RSpecRails/HaveHttpStatus: Prefer expect(last_response).to be_successful over expect(last_response.status).to eq(200)
instead of
RSpecRails/HaveHttpStatus: Prefer expect(last_response).to have_http_status(200) over expect(last_response.status).to eq(200).
I don't know if there's a way to implicitely enforce be_***
style when last_reponse
is found. I'm not that familiar with AST.
Maybe it could be its own cop but outside of Rails.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working