Fix public flag for contact retractions
This commit is contained in:
parent
4244f2a5df
commit
0f551c7b19
2 changed files with 7 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ class Retraction
|
|||
end
|
||||
|
||||
def public?
|
||||
data[:target][:public]
|
||||
data[:target] && data[:target][:public]
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ describe Retraction do
|
|||
end
|
||||
|
||||
it "creates a retraction for a contact" do
|
||||
contact = FactoryGirl.create(:contact)
|
||||
contact = FactoryGirl.build(:contact, receiving: false)
|
||||
|
||||
expect(Diaspora::Federation::Entities).to receive(:retraction_data_for).with(contact)
|
||||
|
||||
|
|
@ -156,5 +156,10 @@ describe Retraction do
|
|||
private_post = alice.post(:status_message, text: "destroy!", to: alice.aspects.first.id)
|
||||
expect(Retraction.for(private_post).public?).to be_falsey
|
||||
end
|
||||
|
||||
it "returns false for a contact retraction" do
|
||||
contact = FactoryGirl.create(:contact, receiving: false)
|
||||
expect(Retraction.for(contact).public?).to be_falsey
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue