0
0
Fork 0

Fix RSpec/SubjectDeclaration cop (#25312)

This commit is contained in:
Matt Jankowski 2023-07-12 03:49:33 -04:00 committed by GitHub
parent f134a5f9d8
commit c75df62ccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 45 additions and 51 deletions

View file

@ -4,11 +4,11 @@ require 'rails_helper'
RSpec.describe AccountMigration do
describe 'validations' do
subject { described_class.new(account: source_account, acct: target_acct) }
let(:source_account) { Fabricate(:account) }
let(:target_acct) { target_account.acct }
let(:subject) { described_class.new(account: source_account, acct: target_acct) }
context 'with valid properties' do
let(:target_account) { Fabricate(:account, username: 'target', domain: 'remote.org') }

View file

@ -20,7 +20,9 @@ RSpec.describe Account do
end
context 'when the account is of a local user' do
let!(:subject) { Fabricate(:user, email: 'foo+bar@domain.org').account }
subject { local_user_account }
let!(:local_user_account) { Fabricate(:user, email: 'foo+bar@domain.org').account }
it 'creates a canonical domain block' do
subject.suspend!

View file

@ -7,7 +7,7 @@ describe RelationshipFilter do
describe '#results' do
context 'when default params are used' do
let(:subject) do
subject do
described_class.new(account, 'order' => 'active').results
end

View file

@ -93,7 +93,7 @@ RSpec.describe UserRole do
describe '#computed_permissions' do
context 'when the role is nobody' do
let(:subject) { described_class.nobody }
subject { described_class.nobody }
it 'returns none' do
expect(subject.computed_permissions).to eq UserRole::Flags::NONE
@ -101,7 +101,7 @@ RSpec.describe UserRole do
end
context 'when the role is everyone' do
let(:subject) { described_class.everyone }
subject { described_class.everyone }
it 'returns permissions' do
expect(subject.computed_permissions).to eq subject.permissions