You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
551 B
20 lines
551 B
8 years ago
|
require 'rails_helper'
|
||
|
|
||
|
RSpec.describe BlockDomainFromAccountService do
|
||
|
let!(:wolf) { Fabricate(:account, username: 'wolf', domain: 'evil.org') }
|
||
|
let!(:alice) { Fabricate(:account, username: 'alice') }
|
||
|
|
||
|
subject { BlockDomainFromAccountService.new }
|
||
|
|
||
|
it 'creates domain block' do
|
||
|
subject.call(alice, 'evil.org')
|
||
|
expect(alice.domain_blocking?('evil.org')).to be true
|
||
|
end
|
||
|
|
||
|
it 'purge followers from blocked domain' do
|
||
|
wolf.follow!(alice)
|
||
|
subject.call(alice, 'evil.org')
|
||
|
expect(wolf.following?(alice)).to be false
|
||
|
end
|
||
|
end
|