diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2e9de6b8d..4b08155e0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1489,15 +1489,6 @@ Rails/RakeEnvironment: - 'lib/tasks/repo.rake' - 'lib/tasks/statistics.rake' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Include. -# Include: spec/controllers/**/*.rb, spec/requests/**/*.rb, test/controllers/**/*.rb, test/integration/**/*.rb -Rails/ResponseParsedBody: - Exclude: - - 'spec/controllers/follower_accounts_controller_spec.rb' - - 'spec/controllers/following_accounts_controller_spec.rb' - - 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb' - # Configuration parameters: Include. # Include: db/**/*.rb Rails/ReversibleMigration: diff --git a/spec/controllers/follower_accounts_controller_spec.rb b/spec/controllers/follower_accounts_controller_spec.rb index 7c53e5b47..0551dfcde 100644 --- a/spec/controllers/follower_accounts_controller_spec.rb +++ b/spec/controllers/follower_accounts_controller_spec.rb @@ -41,7 +41,7 @@ describe FollowerAccountsController do context 'when format is json' do subject(:response) { get :index, params: { account_username: alice.username, page: page, format: :json } } - subject(:body) { JSON.parse(response.body) } + subject(:body) { response.parsed_body } context 'with page' do let(:page) { 1 } diff --git a/spec/controllers/following_accounts_controller_spec.rb b/spec/controllers/following_accounts_controller_spec.rb index 122f72e2d..b049df890 100644 --- a/spec/controllers/following_accounts_controller_spec.rb +++ b/spec/controllers/following_accounts_controller_spec.rb @@ -41,7 +41,7 @@ describe FollowingAccountsController do context 'when format is json' do subject(:response) { get :index, params: { account_username: alice.username, page: page, format: :json } } - subject(:body) { JSON.parse(response.body) } + subject(:body) { response.parsed_body } context 'with page' do let(:page) { 1 } diff --git a/spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb b/spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb index a95521c94..719f70f16 100644 --- a/spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb +++ b/spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb @@ -140,7 +140,7 @@ describe Settings::TwoFactorAuthentication::WebauthnCredentialsController do it 'includes existing credentials in list of excluded credentials' do get :options - excluded_credentials_ids = JSON.parse(response.body)['excludeCredentials'].pluck('id') + excluded_credentials_ids = response.parsed_body['excludeCredentials'].pluck('id') expect(excluded_credentials_ids).to match_array(user.webauthn_credentials.pluck(:external_id)) end end