The code powering m.abunchtell.com https://m.abunchtell.com
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

23 строки
725 B

  1. require 'rails_helper'
  2. RSpec.describe ProcessMentionsService do
  3. let(:account) { Fabricate(:account, username: 'alice') }
  4. let(:remote_user) { Fabricate(:account, username: 'remote_user', domain: 'example.com', salmon_url: 'http://salmon.example.com') }
  5. let(:status) { Fabricate(:status, account: account, text: "Hello @#{remote_user.acct}") }
  6. subject { ProcessMentionsService.new }
  7. before do
  8. stub_request(:post, remote_user.salmon_url)
  9. subject.(status)
  10. end
  11. it 'creates a mention' do
  12. expect(remote_user.mentions.where(status: status).count).to eq 1
  13. end
  14. it 'posts to remote user\'s Salmon end point' do
  15. expect(a_request(:post, remote_user.salmon_url)).to have_been_made
  16. end
  17. end