Commit 9eadc251 authored by realtin's avatar realtin Committed by Jonne Haß

added post guid to the post_serializer

closes #6185
parent 787c1cfc
......@@ -16,6 +16,7 @@
* 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
......
module Export
class PostSerializer < ActiveModel::Serializer
attributes :text,
attributes :guid,
:text,
:public,
:diaspora_handle,
:type,
......
......@@ -4,7 +4,7 @@ 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}\"") }
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment