闭社主体 forked from https://github.com/tootsuite/mastodon
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.

19 lines
567 B

  1. require 'rails_helper'
  2. RSpec.describe BlockDomainFromAccountService, type: :service 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