Clean up of `RSpec/LetSetup` within `spec/models` (#28444)

main
Matt Jankowski 2023-12-21 04:18:38 -05:00 committed by GitHub
parent 87e2bd02ac
commit c753b1ad35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -63,11 +63,8 @@ RSpec/LetSetup:
- 'spec/lib/activitypub/activity/delete_spec.rb'
- 'spec/lib/vacuum/applications_vacuum_spec.rb'
- 'spec/lib/vacuum/preview_cards_vacuum_spec.rb'
- 'spec/models/account_spec.rb'
- 'spec/models/account_statuses_cleanup_policy_spec.rb'
- 'spec/models/canonical_email_block_spec.rb'
- 'spec/models/status_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/services/account_statuses_cleanup_service_spec.rb'
- 'spec/services/activitypub/fetch_featured_collection_service_spec.rb'
- 'spec/services/activitypub/fetch_remote_status_service_spec.rb'

View File

@ -954,6 +954,7 @@ RSpec.describe Account do
it 'returns every usable non-suspended account' do
expect(described_class.searchable).to contain_exactly(silenced_local, silenced_remote, local_account, remote_account)
expect(described_class.searchable).to_not include(suspended_local, suspended_remote, unconfirmed, unapproved)
end
it 'does not mess with previously-applied scopes' do

View File

@ -28,7 +28,7 @@ RSpec.describe CanonicalEmailBlock do
end
describe '.block?' do
let!(:canonical_email_block) { Fabricate(:canonical_email_block, email: 'foo@bar.com') }
before { Fabricate(:canonical_email_block, email: 'foo@bar.com') }
it 'returns true for the same email' do
expect(described_class.block?('foo@bar.com')).to be true

View File

@ -422,6 +422,7 @@ RSpec.describe User do
it 'deactivates all sessions' do
expect(user.session_activations.count).to eq 0
expect { session_activation.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
it 'revokes all access tokens' do
@ -430,6 +431,7 @@ RSpec.describe User do
it 'removes push subscriptions' do
expect(Web::PushSubscription.where(user: user).or(Web::PushSubscription.where(access_token: access_token)).count).to eq 0
expect { web_push_subscription.reload }.to raise_error(ActiveRecord::RecordNotFound)
end
end