fix TODOs in federation specs

This commit is contained in:
Benjamin Neff 2016-05-15 01:12:32 +02:00
parent 59bb46eeb6
commit a7f6c84bf3
3 changed files with 8 additions and 9 deletions

View file

@ -83,7 +83,7 @@ describe "Receive federation messages feature" do
it "treats sharing request recive correctly" do it "treats sharing request recive correctly" do
entity = FactoryGirl.build(:request_entity, author: sender_id, recipient: alice.diaspora_handle) entity = FactoryGirl.build(:request_entity, author: sender_id, recipient: alice.diaspora_handle)
# TODO: expect(Diaspora::Fetcher::Public).to receive(:queue_for).exactly(1).times expect(Workers::ReceiveLocal).to receive(:perform_async).and_call_original
post_message(generate_xml(entity, sender, alice), alice) post_message(generate_xml(entity, sender, alice), alice)

View file

@ -3,7 +3,7 @@ shared_examples_for "it deals correctly with a relayable" do
let(:entity) { create_relayable_entity(entity_name, local_parent, sender_id) } let(:entity) { create_relayable_entity(entity_name, local_parent, sender_id) }
it "treats upstream receive correctly" do it "treats upstream receive correctly" do
# TODO: expect(Postzord::Dispatcher).to receive(:build).with(alice, kind_of(klass)).and_call_original expect(Workers::ReceiveLocal).to receive(:perform_async)
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)
received_entity = klass.find_by(guid: entity.guid) received_entity = klass.find_by(guid: entity.guid)
@ -13,7 +13,7 @@ shared_examples_for "it deals correctly with a relayable" do
# Checks when a remote pod wants to send us a relayable without having a key for declared diaspora ID # Checks when a remote pod wants to send us a relayable without having a key for declared diaspora ID
it "rejects an upstream entity with a malformed author signature" do it "rejects an upstream entity with a malformed author signature" do
# TODO: expect(Postzord::Dispatcher).not_to receive(:build) expect(Workers::ReceiveLocal).not_to receive(:perform_async)
allow(remote_user_on_pod_b).to receive(:encryption_key).and_return(OpenSSL::PKey::RSA.new(1024)) allow(remote_user_on_pod_b).to receive(:encryption_key).and_return(OpenSSL::PKey::RSA.new(1024))
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)
@ -26,8 +26,7 @@ shared_examples_for "it deals correctly with a relayable" do
let(:entity) { create_relayable_entity(entity_name, remote_parent, author_id) } let(:entity) { create_relayable_entity(entity_name, remote_parent, author_id) }
it "treats downstream receive correctly" do it "treats downstream receive correctly" do
# TODO: expect(Postzord::Dispatcher).to receive(:build) expect(Workers::ReceiveLocal).to receive(:perform_async)
# .with(alice, kind_of(klass)).and_call_original unless recipient.nil?
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)
@ -39,7 +38,7 @@ shared_examples_for "it deals correctly with a relayable" do
# Checks when a remote pod B wants to send us a relayable with authorship from a remote pod C user # Checks when a remote pod B wants to send us a relayable with authorship from a remote pod C user
# without having correct signature from him. # without having correct signature from him.
it "rejects a downstream entity with a malformed author signature" do it "rejects a downstream entity with a malformed author signature" do
# TODO: expect(Postzord::Dispatcher).not_to receive(:build) expect(Workers::ReceiveLocal).not_to receive(:perform_async)
allow(remote_user_on_pod_c).to receive(:encryption_key).and_return(OpenSSL::PKey::RSA.new(1024)) allow(remote_user_on_pod_c).to receive(:encryption_key).and_return(OpenSSL::PKey::RSA.new(1024))
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)
@ -49,7 +48,7 @@ shared_examples_for "it deals correctly with a relayable" do
# Checks when a remote pod C wants to send us a relayable from its user, but bypassing the pod B where # Checks when a remote pod C wants to send us a relayable from its user, but bypassing the pod B where
# remote status came from. # remote status came from.
it "declines downstream receive when sender signed with a wrong key" do it "declines downstream receive when sender signed with a wrong key" do
# TODO: expect(Postzord::Dispatcher).not_to receive(:build) expect(Workers::ReceiveLocal).not_to receive(:perform_async)
allow(sender).to receive(:encryption_key).and_return(OpenSSL::PKey::RSA.new(1024)) allow(sender).to receive(:encryption_key).and_return(OpenSSL::PKey::RSA.new(1024))
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)

View file

@ -65,7 +65,7 @@ shared_examples_for "messages which are indifferent about sharing fact" do
let(:entity) { create_relayable_entity(:participation_entity, local_parent, sender_id) } let(:entity) { create_relayable_entity(:participation_entity, local_parent, sender_id) }
it "treats participation receive correctly" do it "treats participation receive correctly" do
# TODO: expect(Postzord::Dispatcher).to receive(:build).with(alice, kind_of(Participations)).and_call_original expect(Workers::ReceiveLocal).to receive(:perform_async)
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)
received_entity = Participation.find_by(guid: entity.guid) received_entity = Participation.find_by(guid: entity.guid)
@ -74,7 +74,7 @@ shared_examples_for "messages which are indifferent about sharing fact" do
end end
it "rejects a participations for a remote parent" do it "rejects a participations for a remote parent" do
# TODO: expect(Postzord::Dispatcher).not_to receive(:build) expect(Workers::ReceiveLocal).not_to receive(:perform_async)
entity = create_relayable_entity(:participation_entity, remote_parent, sender_id) entity = create_relayable_entity(:participation_entity, remote_parent, sender_id)
post_message(generate_xml(entity, sender, recipient), recipient) post_message(generate_xml(entity, sender, recipient), recipient)