|
|
|
@ -31,11 +31,11 @@ RSpec.describe AccountWarningPolicy do
|
|
|
|
|
|
|
|
|
|
context 'when account is target' do
|
|
|
|
|
context 'when record is appealable' do
|
|
|
|
|
it { is_expected.to permit(account, AccountWarning.new(target_account_id: account.id, created_at: Appeal::MAX_STRIKE_AGE.ago + 1.hour)) }
|
|
|
|
|
it { is_expected.to permit(account, AccountWarning.new(target_account_id: account.id, created_at: AccountWarning::APPEAL_WINDOW.ago + 1.hour)) }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
context 'when record is not appealable' do
|
|
|
|
|
it { is_expected.to_not permit(account, AccountWarning.new(target_account_id: account.id, created_at: Appeal::MAX_STRIKE_AGE.ago - 1.hour)) }
|
|
|
|
|
it { is_expected.to_not permit(account, AccountWarning.new(target_account_id: account.id, created_at: AccountWarning::APPEAL_WINDOW.ago - 1.hour)) }
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|