block_domain_from_account_service_spec.rb 551 B

12345678910111213141516171819
  1. require 'rails_helper'
  2. RSpec.describe BlockDomainFromAccountService do
  3. let!(:wolf) { Fabricate(:account, username: 'wolf', domain: 'evil.org') }
  4. let!(:alice) { Fabricate(:account, username: 'alice') }
  5. subject { BlockDomainFromAccountService.new }
  6. it 'creates domain block' do
  7. subject.call(alice, 'evil.org')
  8. expect(alice.domain_blocking?('evil.org')).to be true
  9. end
  10. it 'purge followers from blocked domain' do
  11. wolf.follow!(alice)
  12. subject.call(alice, 'evil.org')
  13. expect(wolf.following?(alice)).to be false
  14. end
  15. end