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.

23 lines
676 B

  1. require 'rails_helper'
  2. RSpec.describe ReblogService do
  3. let(:alice) { Fabricate(:account, username: 'alice') }
  4. let(:bob) { Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com') }
  5. let(:status) { Fabricate(:status, account: bob, uri: 'tag:example.com;something:something') }
  6. subject { ReblogService.new }
  7. before do
  8. stub_request(:post, 'http://salmon.example.com')
  9. subject.(alice, status)
  10. end
  11. it 'creates a reblog' do
  12. expect(status.reblogs.count).to eq 1
  13. end
  14. it 'sends a Salmon slap for a remote reblog' do
  15. expect(a_request(:post, 'http://salmon.example.com')).to have_been_made
  16. end
  17. end