chore: rubocop

chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
This commit is contained in:
Philipp Rothmann 2023-05-12 13:01:12 +02:00 committed by Philipp Rothmann
parent f6fb804bbe
commit fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions

View file

@ -4,12 +4,14 @@ module ApiHelper
included do
let(:user) { create(:user) }
let(:api_scopes) { [] } # empty scopes for stricter testing (in reality this would be default_scopes)
let(:api_access_token) { create(:oauth2_access_token, resource_owner_id: user.id, scopes: api_scopes&.join(' ')).token }
let(:Authorization) { "Bearer #{api_access_token}" }
let(:api_access_token) do
create(:oauth2_access_token, resource_owner_id: user.id, scopes: api_scopes&.join(' ')).token
end
let(:Authorization) { "Bearer #{api_access_token}" } # rubocop:disable RSpec/VariableName
def self.it_handles_invalid_token
context 'with invalid access token' do
let(:Authorization) { 'abc' }
let(:Authorization) { 'abc' } # rubocop:disable RSpec/VariableName
response 401, 'not logged-in' do
schema '$ref' => '#/components/schemas/Error401'
@ -20,7 +22,7 @@ module ApiHelper
def self.it_handles_invalid_token_with_id
context 'with invalid access token' do
let(:Authorization) { 'abc' }
let(:Authorization) { 'abc' } # rubocop:disable RSpec/VariableName
let(:id) { 42 } # id doesn't matter here
response 401, 'not logged-in' do