mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-24 23:01:20 +00:00
Add coverage for unresolved_siblings?
This commit is contained in:
parent
aad8fd8ce8
commit
e8e63fc330
|
@ -120,6 +120,28 @@ RSpec.describe Report do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#unresolved_siblings?' do
|
||||
subject { Fabricate :report }
|
||||
|
||||
context 'when the target account has other unresolved reports' do
|
||||
before { Fabricate :report, action_taken_at: nil, target_account: subject.target_account }
|
||||
|
||||
it { is_expected.to be_unresolved_siblings }
|
||||
end
|
||||
|
||||
context 'when the target account has a resolved report' do
|
||||
before { Fabricate :report, action_taken_at: 3.days.ago, target_account: subject.target_account }
|
||||
|
||||
it { is_expected.to_not be_unresolved_siblings }
|
||||
end
|
||||
|
||||
context 'when the target account has no other reports' do
|
||||
before { described_class.where(target_account: subject.target_account).destroy_all }
|
||||
|
||||
it { is_expected.to_not be_unresolved_siblings }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'validations' do
|
||||
subject { Fabricate.build :report }
|
||||
|
||||
|
|
Loading…
Reference in a new issue