mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 12:55:56 +01:00
Clean up of RSpec/LetSetup
within spec/models
(#28444)
This commit is contained in:
parent
87e2bd02ac
commit
c753b1ad35
4 changed files with 4 additions and 4 deletions
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue