Simplify model validation specs for AccountStatusCleanupPolicy
(#32495)
This commit is contained in:
parent
66c0471515
commit
9464281f29
@ -5,13 +5,12 @@ require 'rails_helper'
|
|||||||
RSpec.describe AccountStatusesCleanupPolicy do
|
RSpec.describe AccountStatusesCleanupPolicy do
|
||||||
let(:account) { Fabricate(:account, username: 'alice', domain: nil) }
|
let(:account) { Fabricate(:account, username: 'alice', domain: nil) }
|
||||||
|
|
||||||
describe 'validation' do
|
describe 'Validations' do
|
||||||
it 'disallow remote accounts' do
|
subject { Fabricate.build :account_statuses_cleanup_policy }
|
||||||
account.update(domain: 'example.com')
|
|
||||||
account_statuses_cleanup_policy = Fabricate.build(:account_statuses_cleanup_policy, account: account)
|
let(:remote_account) { Fabricate(:account, domain: 'example.com') }
|
||||||
account_statuses_cleanup_policy.valid?
|
|
||||||
expect(account_statuses_cleanup_policy).to model_have_error_on_field(:account)
|
it { is_expected.to_not allow_value(remote_account).for(:account) }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'save hooks' do
|
describe 'save hooks' do
|
||||||
|
Loading…
Reference in New Issue
Block a user