diaspora/spec/shared_behaviors/federation_entity_serializer.rb
cmrd Senya 7374661e2f
Update the user data export archive format.
This commit introduces changes to the user data export archive format.
This extends data set which is included in the archive. This data can be
then imported to other pods when this feature is implemented.

Also the commit adds the archive format json schema. ATM it is used in
automatic tests only, but in future it will also be used to validate
incoming archives.
2017-08-10 09:36:26 +03:00

14 lines
482 B
Ruby

shared_examples_for "a federation entity serializer" do
describe "#to_json" do
it "contains JSON serialized entity object" do
entity = nil
expect(Diaspora::Federation::Entities).to receive(:build)
.with(object)
.and_wrap_original do |original, object, &block|
entity = original.call(object, &block)
end
json = described_class.new(object, root: false).to_json
expect(json).to include_json(entity.to_json)
end
end
end