Add notifications for statuses deleted by moderators (#17204)
This commit is contained in:
parent
d5c9feb7b7
commit
14f436c457
59 changed files with 1220 additions and 598 deletions
|
@ -54,7 +54,7 @@ describe Report do
|
|||
end
|
||||
|
||||
describe 'resolve!' do
|
||||
subject(:report) { Fabricate(:report, action_taken: false, action_taken_by_account_id: nil) }
|
||||
subject(:report) { Fabricate(:report, action_taken_at: nil, action_taken_by_account_id: nil) }
|
||||
|
||||
let(:acting_account) { Fabricate(:account) }
|
||||
|
||||
|
@ -63,12 +63,13 @@ describe Report do
|
|||
end
|
||||
|
||||
it 'records action taken' do
|
||||
expect(report).to have_attributes(action_taken: true, action_taken_by_account_id: acting_account.id)
|
||||
expect(report.action_taken?).to be true
|
||||
expect(report.action_taken_by_account_id).to eq acting_account.id
|
||||
end
|
||||
end
|
||||
|
||||
describe 'unresolve!' do
|
||||
subject(:report) { Fabricate(:report, action_taken: true, action_taken_by_account_id: acting_account.id) }
|
||||
subject(:report) { Fabricate(:report, action_taken_at: Time.now.utc, action_taken_by_account_id: acting_account.id) }
|
||||
|
||||
let(:acting_account) { Fabricate(:account) }
|
||||
|
||||
|
@ -77,23 +78,24 @@ describe Report do
|
|||
end
|
||||
|
||||
it 'unresolves' do
|
||||
expect(report).to have_attributes(action_taken: false, action_taken_by_account_id: nil)
|
||||
expect(report.action_taken?).to be false
|
||||
expect(report.action_taken_by_account_id).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe 'unresolved?' do
|
||||
subject { report.unresolved? }
|
||||
|
||||
let(:report) { Fabricate(:report, action_taken: action_taken) }
|
||||
let(:report) { Fabricate(:report, action_taken_at: action_taken) }
|
||||
|
||||
context 'if action is taken' do
|
||||
let(:action_taken) { true }
|
||||
let(:action_taken) { Time.now.utc }
|
||||
|
||||
it { is_expected.to be false }
|
||||
end
|
||||
|
||||
context 'if action not is taken' do
|
||||
let(:action_taken) { false }
|
||||
let(:action_taken) { nil }
|
||||
|
||||
it { is_expected.to be true }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue