diff --git a/spec/controllers/diaspora_federation/receive_controller_spec.rb b/spec/controllers/diaspora_federation/receive_controller_spec.rb
index 2ec50da..9f77fce 100644
--- a/spec/controllers/diaspora_federation/receive_controller_spec.rb
+++ b/spec/controllers/diaspora_federation/receive_controller_spec.rb
@@ -15,6 +15,13 @@ module DiasporaFederation
post :public, xml: ""
expect(response.code).to eq("200")
end
+
+ it "unescapes the xml before sending it to the callback" do
+ expect(DiasporaFederation.callbacks).to receive(:trigger)
+ .with(:queue_public_receive, "")
+
+ post :public, xml: CGI::escape("")
+ end
end
describe "POST #private" do
@@ -32,7 +39,7 @@ module DiasporaFederation
expect(response.code).to eq("422")
end
- it "returns a 200 if receive! reports no errors" do
+ it "returns a 200 if the callback returned true" do
expect(DiasporaFederation.callbacks).to receive(:trigger)
.with(:queue_private_receive, "any-guid", "")
.and_return(true)
@@ -40,6 +47,14 @@ module DiasporaFederation
post :private, guid: "any-guid", xml: ""
expect(response.code).to eq("200")
end
+
+ it "unescapes the xml before sending it to the callback" do
+ expect(DiasporaFederation.callbacks).to receive(:trigger)
+ .with(:queue_private_receive, "any-guid", "")
+ .and_return(true)
+
+ post :private, guid: "any-guid", xml: CGI::escape("")
+ end
end
end
end