Add extended domain block tests
This commit is contained in:
parent
43144661ea
commit
7a0bf2e948
6 changed files with 231 additions and 15 deletions
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::Activity::Like do
|
||||
let(:sender) { Fabricate(:account) }
|
||||
let(:sender) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/') }
|
||||
let(:recipient) { Fabricate(:account) }
|
||||
let(:status) { Fabricate(:status, account: recipient) }
|
||||
|
||||
|
@ -28,4 +28,30 @@ RSpec.describe ActivityPub::Activity::Like do
|
|||
expect(sender.favourited?(status)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
describe '#perform when domain_block' do
|
||||
subject { described_class.new(json, sender) }
|
||||
|
||||
before do
|
||||
Fabricate(:domain_block, domain: 'example.com', severity: :noop, reject_favourite: true)
|
||||
subject.perform
|
||||
end
|
||||
|
||||
it 'does not create a favourite from sender to status' do
|
||||
expect(sender.favourited?(status)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
describe '#perform when normal domain_block' do
|
||||
subject { described_class.new(json, sender) }
|
||||
|
||||
before do
|
||||
Fabricate(:domain_block, domain: 'example.com', severity: :suspend)
|
||||
subject.perform
|
||||
end
|
||||
|
||||
it 'does not create a favourite from sender to status', pending: 'considering spec' do
|
||||
expect(sender.favourited?(status)).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue