Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions docs/modules/ROOT/pages/cops_rspecrails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ end

Checks that tests use `have_http_status` instead of equality matchers.

[#safety-rspecrailshavehttpstatus]
=== Safety

The autocorrection is marked as unsafe because
`response.status` response is not always an HTTP response.

[#examples-rspecrailshavehttpstatus]
=== Examples

Expand Down
4 changes: 4 additions & 0 deletions lib/rubocop/cop/rspec_rails/have_http_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module Cop
module RSpecRails
# Checks that tests use `have_http_status` instead of equality matchers.
#
# @safety
# The autocorrection is marked as unsafe because
# `response.status` response is not always an HTTP response.
#
# @example ResponseMethods: ['response', 'last_response'] (default)
# # bad
# expect(response.status).to be(200)
Expand Down