Merge branch 'stable' into develop

This commit is contained in:
Dennis Schubert 2016-01-24 07:15:04 +01:00
commit 515cda7658
3 changed files with 7 additions and 4 deletions

View file

@ -107,6 +107,7 @@ Contributions are very welcome, the hard work is done!
## Bug fixes ## Bug fixes
* Fix plural rules handling more than wanted as "one" [#6630](https://github.com/diaspora/diaspora/pull/6630) * Fix plural rules handling more than wanted as "one" [#6630](https://github.com/diaspora/diaspora/pull/6630)
* Fix `suppress_annoying_errors` eating too much errors [#6653](https://github.com/diaspora/diaspora/pull/6653)
## Features ## Features
* Keyboard shortcuts now do work on profile pages as well [#6647](https://github.com/diaspora/diaspora/pull/6647/files) * Keyboard shortcuts now do work on profile pages as well [#6647](https://github.com/diaspora/diaspora/pull/6647/files)

View file

@ -24,10 +24,10 @@ module Workers
logger.warn "error on receive: #{e.class}" logger.warn "error on receive: #{e.class}"
rescue ActiveRecord::RecordInvalid => e rescue ActiveRecord::RecordInvalid => e
logger.warn "failed to save received object: #{e.record.errors.full_messages}" logger.warn "failed to save received object: #{e.record.errors.full_messages}"
raise e unless %w( raise e unless [
"already been taken" "already been taken",
"is ignored by the post author" "is ignored by the post author"
).any? {|reason| e.message.include? reason } ].any? {|reason| e.message.include? reason }
end end
end end
end end

View file

@ -46,7 +46,9 @@ describe "Receive federation messages feature" do
post = FactoryGirl.create(:status_message, author: alice.person, public: false) post = FactoryGirl.create(:status_message, author: alice.person, public: false)
reshare = FactoryGirl.build( reshare = FactoryGirl.build(
:reshare_entity, root_diaspora_id: alice.diaspora_handle, root_guid: post.guid, diaspora_id: sender_id) :reshare_entity, root_diaspora_id: alice.diaspora_handle, root_guid: post.guid, diaspora_id: sender_id)
post_message(generate_xml(reshare, sender)) expect {
post_message(generate_xml(reshare, sender))
}.to raise_error ActiveRecord::RecordInvalid, "Validation failed: Only posts which are public may be reshared."
expect(Reshare.exists?(root_guid: post.guid, diaspora_handle: sender_id)).to be_falsey expect(Reshare.exists?(root_guid: post.guid, diaspora_handle: sender_id)).to be_falsey
end end