Fix RSpec/SubjectDeclaration
cop (#25312)
This commit is contained in:
parent
f134a5f9d8
commit
c75df62ccc
21 changed files with 45 additions and 51 deletions
|
@ -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') }
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue