Commit 787c1cfc authored by zaziemo's avatar zaziemo Committed by Jonne Haß

add spec and code to include guid in comment's export

#6115
parent 2df4a1cc
module Export
class CommentSerializer < ActiveModel::Serializer
attributes :text,
attributes :guid,
:text,
:post_guid
def post_guid
......
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
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