|
@@ -53,10 +53,11 @@ RSpec.describe FollowService do
|
|
end
|
|
end
|
|
|
|
|
|
describe 'unlocked account' do
|
|
describe 'unlocked account' do
|
|
- let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
|
|
|
|
|
|
+ let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com', hub_url: 'http://hub.example.com')).account }
|
|
|
|
|
|
before do
|
|
before do
|
|
stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
|
|
stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
|
|
|
|
+ stub_request(:post, "http://hub.example.com/").to_return(status: 202)
|
|
subject.call(sender, bob.acct)
|
|
subject.call(sender, bob.acct)
|
|
end
|
|
end
|
|
|
|
|
|
@@ -70,6 +71,10 @@ RSpec.describe FollowService do
|
|
xml.match(TagManager::VERBS[:follow])
|
|
xml.match(TagManager::VERBS[:follow])
|
|
}).to have_been_made.once
|
|
}).to have_been_made.once
|
|
end
|
|
end
|
|
|
|
+
|
|
|
|
+ it 'subscribes to PuSH' do
|
|
|
|
+ expect(a_request(:post, "http://hub.example.com/")).to have_been_made.once
|
|
|
|
+ end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|