Merge branch 'stable' into develop

This commit is contained in:
Jonne Haß 2015-07-11 00:17:19 +02:00
commit 84d5a13ce1
5 changed files with 35 additions and 2 deletions

View file

@ -63,6 +63,7 @@ bind to an UNIX socket at `unix:tmp/diaspora.sock`. Please change your local
* Add configuration options for some debug logs [#6090](https://github.com/diaspora/diaspora/pull/6090)
* Send new users a welcome message from the podmin [#6128](https://github.com/diaspora/diaspora/pull/6128)
* Cleanup temporary upload files daily [#6147](https://github.com/diaspora/diaspora/pull/6147)
* Add guid to posts and comments in the user export [#6185](https://github.com/diaspora/diaspora/pull/6185)
# 0.5.1.2

View file

@ -1,6 +1,7 @@
module Export
class CommentSerializer < ActiveModel::Serializer
attributes :text,
attributes :guid,
:text,
:post_guid
def post_guid

View file

@ -1,6 +1,7 @@
module Export
class PostSerializer < ActiveModel::Serializer
attributes :text,
attributes :guid,
:text,
:public,
:diaspora_handle,
:type,

View file

@ -0,0 +1,10 @@
require "spec_helper"
describe Export::CommentSerializer do
let(:comment) { create(:comment) }
subject(:json_output) { Export::CommentSerializer.new(comment).to_json }
it { is_expected.to include %("guid":"#{comment.guid}") }
it { is_expected.to include %("post_guid":"#{comment.post.guid}") }
it { is_expected.to include %("text":"#{comment.text}") }
end

View file

@ -0,0 +1,20 @@
require "spec_helper"
describe Export::PostSerializer do
let(:post) { create(:status_message_with_photo) }
subject(:json_output) { Export::PostSerializer.new(post).to_json }
it { is_expected.to include %("guid":"#{post.guid}") }
it { is_expected.to include %("text":"#{post.text}") }
it { is_expected.to include %("public":#{post.public}) }
it { is_expected.to include %("diaspora_handle":"#{post.diaspora_handle}") }
it { is_expected.to include %("type":"#{post.type}") }
it { is_expected.to include %("image_url":#{post.image_url}) }
it { is_expected.to include %("image_height":#{post.image_height}) }
it { is_expected.to include %("image_width":#{post.image_width}) }
it { is_expected.to include %("likes_count":#{post.likes_count}) }
it { is_expected.to include %("comments_count":#{post.comments_count}) }
it { is_expected.to include %("reshares_count":#{post.reshares_count}) }
it { is_expected.to include %("created_at":"#{post.created_at.to_s[0, 4]}) }
it { is_expected.to include %("created_at":"#{post.created_at.strftime('%FT%T.%LZ')}) }
end