diff --git a/docs/modules/ROOT/pages/cops_rspecrails.adoc b/docs/modules/ROOT/pages/cops_rspecrails.adoc index 07650f9..ced770d 100644 --- a/docs/modules/ROOT/pages/cops_rspecrails.adoc +++ b/docs/modules/ROOT/pages/cops_rspecrails.adoc @@ -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 diff --git a/lib/rubocop/cop/rspec_rails/have_http_status.rb b/lib/rubocop/cop/rspec_rails/have_http_status.rb index 71bd168..e289417 100644 --- a/lib/rubocop/cop/rspec_rails/have_http_status.rb +++ b/lib/rubocop/cop/rspec_rails/have_http_status.rb @@ -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)