New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6115 add guid to comments and posts for user export #6185
Changes from 3 commits
85cbb0a
3b38204
2937e3e
4cee89b
625b81b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 } | ||
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]}") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by mess up? That the format doesn't match There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
=> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's simply ISO 8601:
|
||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file lacks the .rb extension ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it would be good to use percent literals for all these to avoid all the escaping:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't aware of this! Thank you!