From c4e32ea5288fbd6ac6aebb72f9cf8f3687f339e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 29 Aug 2023 19:44:47 +0200 Subject: [PATCH] Add and apply HaveHttpStatus rubocop rule This rule was added in rubocop-rspec 2.12.0. We were already applying it most of the time. --- .rubocop.yml | 3 +++ spec/controllers/admin/api/stats_controller_spec.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 131ba2aa6..252159fda 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -544,6 +544,9 @@ RSpec/NotToNot: RSpec/OverwritingSetup: Enabled: true +RSpec/Rails/HaveHttpStatus: + Enabled: true + RSpec/RepeatedExample: Enabled: true diff --git a/spec/controllers/admin/api/stats_controller_spec.rb b/spec/controllers/admin/api/stats_controller_spec.rb index 1f07a554d..042d1d3d1 100644 --- a/spec/controllers/admin/api/stats_controller_spec.rb +++ b/spec/controllers/admin/api/stats_controller_spec.rb @@ -7,7 +7,7 @@ describe Admin::Api::StatsController, :admin do get :show expect(response).not_to be_ok - expect(response.status).to eq 400 + expect(response).to have_http_status 400 end end