From c5ecc872ce254177e2326d5e68edafad4f2aa471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Thu, 28 Feb 2013 17:20:33 +0100 Subject: [PATCH] add integration spec for retracting a comment --- spec/integration/receiving_spec.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/spec/integration/receiving_spec.rb b/spec/integration/receiving_spec.rb index 36685d757..0a9579428 100644 --- a/spec/integration/receiving_spec.rb +++ b/spec/integration/receiving_spec.rb @@ -311,14 +311,26 @@ describe 'a user receives a post' do context 'retractions' do it 'should accept retractions' do - message = bob.post(:status_message, :text => "cats", :to => @bobs_aspect.id) + message = bob.post(:status_message, text: "cats", to: @bobs_aspect.id) retraction = Retraction.for(message) xml = retraction.to_diaspora_xml - lambda { - zord = Postzord::Receiver::Private.new(alice, :person => bob.person) + expect { + zord = Postzord::Receiver::Private.new(alice, person: bob.person) zord.parse_and_receive(xml) - }.should change(StatusMessage, :count).by(-1) + }.to change(StatusMessage, :count).by(-1) + end + + it 'should accept relayable retractions' do + message = bob.post(:status_message, text: "cats", to: @bobs_aspect.id) + comment = bob.comment! message, "and dogs" + retraction = RelayableRetraction.build(bob, comment) + xml = retraction.to_diaspora_xml + + expect { + zord = Postzord::Receiver::Private.new(alice, person: bob.person) + zord.parse_and_receive xml + }.to change(Comment, :count).by(-1) end end