parent
787c1cfce9
commit
9eadc251ae
4 changed files with 26 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
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
|
||||
|
|
|
|||
20
spec/serializers/post_serializer_spec.rb
Normal file
20
spec/serializers/post_serializer_spec.rb
Normal 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
|
||||
Loading…
Reference in a new issue