Merge commit 'b9f59ebcc68e9da0a7158741a1a2ef3564e1321e' into merging-upstream

This commit is contained in:
Ondřej Hruška
2017-09-28 09:18:35 +02:00
4750 changed files with 5257 additions and 3475 deletions

View File

@@ -1,7 +1,7 @@
require 'rails_helper'
RSpec.describe ActivityPub::ProcessCollectionService do
let(:actor) { Fabricate(:account) }
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') }
let(:payload) do
{
@@ -24,7 +24,7 @@ RSpec.describe ActivityPub::ProcessCollectionService do
describe '#call' do
context 'when actor is the sender'
context 'when actor differs from sender' do
let(:forwarder) { Fabricate(:account) }
let(:forwarder) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/other_account') }
it 'processes payload with sender if no signature exists' do
expect_any_instance_of(ActivityPub::LinkedDataSignature).not_to receive(:verify_account!)

View File

@@ -42,7 +42,7 @@ RSpec.describe AuthorizeFollowService do
it 'sends a follow request authorization salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:authorize])
xml.match(OStatus::TagManager::VERBS[:authorize])
}).to have_been_made.once
end
end

View File

@@ -50,14 +50,14 @@ RSpec.describe BatchedRemoveStatusService do
it 'sends PuSH update to PuSH subscribers' do
expect(a_request(:post, 'http://example.com/push').with { |req|
matches = req.body.match(TagManager::VERBS[:delete])
matches = req.body.match(OStatus::TagManager::VERBS[:delete])
}).to have_been_made.at_least_once
end
it 'sends Salmon slap to previously mentioned users' do
expect(a_request(:post, "http://example.com/salmon").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:delete])
xml.match(OStatus::TagManager::VERBS[:delete])
}).to have_been_made.once
end

View File

@@ -32,7 +32,7 @@ RSpec.describe BlockService do
it 'sends a block salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:block])
xml.match(OStatus::TagManager::VERBS[:block])
}).to have_been_made.once
end
end

View File

@@ -34,7 +34,7 @@ RSpec.describe FavouriteService do
it 'sends a salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:favorite])
xml.match(OStatus::TagManager::VERBS[:favorite])
}).to have_been_made.once
end
end

View File

@@ -60,7 +60,7 @@ RSpec.describe FollowService do
it 'sends a follow request salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:request_friend])
xml.match(OStatus::TagManager::VERBS[:request_friend])
}).to have_been_made.once
end
end
@@ -81,7 +81,7 @@ RSpec.describe FollowService do
it 'sends a follow salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:follow])
xml.match(OStatus::TagManager::VERBS[:follow])
}).to have_been_made.once
end

View File

@@ -42,7 +42,7 @@ RSpec.describe RejectFollowService do
it 'sends a follow request rejection salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:reject])
xml.match(OStatus::TagManager::VERBS[:reject])
}).to have_been_made.once
end
end

View File

@@ -34,7 +34,7 @@ RSpec.describe RemoveStatusService do
it 'sends PuSH update to PuSH subscribers' do
expect(a_request(:post, 'http://example.com/push').with { |req|
req.body.match(TagManager::VERBS[:delete])
req.body.match(OStatus::TagManager::VERBS[:delete])
}).to have_been_made
end
@@ -45,7 +45,7 @@ RSpec.describe RemoveStatusService do
it 'sends Salmon slap to previously mentioned users' do
expect(a_request(:post, "http://example.com/salmon").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:delete])
xml.match(OStatus::TagManager::VERBS[:delete])
}).to have_been_made.once
end

View File

@@ -34,7 +34,7 @@ RSpec.describe UnblockService do
it 'sends an unblock salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:unblock])
xml.match(OStatus::TagManager::VERBS[:unblock])
}).to have_been_made.once
end
end

View File

@@ -34,7 +34,7 @@ RSpec.describe UnfollowService do
it 'sends an unfollow salmon slap' do
expect(a_request(:post, "http://salmon.example.com/").with { |req|
xml = OStatus2::Salmon.new.unpack(req.body)
xml.match(TagManager::VERBS[:unfollow])
xml.match(OStatus::TagManager::VERBS[:unfollow])
}).to have_been_made.once
end
end