add integration spec for retracting a comment
This commit is contained in:
parent
ccedb6eff0
commit
c5ecc872ce
1 changed files with 16 additions and 4 deletions
|
|
@ -311,14 +311,26 @@ describe 'a user receives a post' do
|
||||||
|
|
||||||
context 'retractions' do
|
context 'retractions' do
|
||||||
it 'should accept 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)
|
retraction = Retraction.for(message)
|
||||||
xml = retraction.to_diaspora_xml
|
xml = retraction.to_diaspora_xml
|
||||||
|
|
||||||
lambda {
|
expect {
|
||||||
zord = Postzord::Receiver::Private.new(alice, :person => bob.person)
|
zord = Postzord::Receiver::Private.new(alice, person: bob.person)
|
||||||
zord.parse_and_receive(xml)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue