diff --git a/lib/diaspora_federation/entities/comment.rb b/lib/diaspora_federation/entities/comment.rb
index 652e265..b5929ef 100644
--- a/lib/diaspora_federation/entities/comment.rb
+++ b/lib/diaspora_federation/entities/comment.rb
@@ -17,12 +17,6 @@ module DiasporaFederation
# Comment entity creation time
# @return [Time] creation time
property :created_at, :timestamp, default: -> { Time.now.utc }
-
- # Remove "created_at" when no order was received.
- # @deprecated TODO: Remove this, this will break compatibility with pods older than 0.6.3.0.
- def signature_order
- @signature_order || super.tap {|order| order.delete(:created_at) }
- end
end
end
end
diff --git a/spec/lib/diaspora_federation/entities/comment_spec.rb b/spec/lib/diaspora_federation/entities/comment_spec.rb
index 99ca055..41016d3 100644
--- a/spec/lib/diaspora_federation/entities/comment_spec.rb
+++ b/spec/lib/diaspora_federation/entities/comment_spec.rb
@@ -19,6 +19,7 @@ module DiasporaFederation
#{data[:guid]}
#{parent.guid}
#{data[:text]}
+ #{data[:created_at].utc.iso8601}
#{data[:author_signature]}
#{data[:parent_author_signature]}
@@ -39,7 +40,8 @@ XML
"author",
"guid",
"parent_guid",
- "text"
+ "text",
+ "created_at"
]
}
JSON
@@ -55,23 +57,5 @@ JSON
it_behaves_like "a relayable Entity"
it_behaves_like "a relayable JSON entity"
-
- describe "#created_at" do
- it "has a created_at after parse" do
- entity = described_class.from_xml(Nokogiri::XML(xml).root)
- expect(entity.created_at).to be_within(1).of(Time.now.utc)
- end
-
- it "parses the created_at from the xml if it is included and correctly signed" do
- created_at = change_time(Time.now.utc) - 60
- comment_data = Fabricate.attributes_for(:comment_entity, author: alice.diaspora_id, parent_guid: parent.guid)
- comment_data[:created_at] = created_at
- comment_data[:parent] = parent_entity
- comment = described_class.new(comment_data, %i(author guid parent_guid text created_at))
-
- parsed_comment = described_class.from_xml(comment.to_xml)
- expect(parsed_comment.created_at).to eq(created_at)
- end
- end
end
end
diff --git a/spec/support/shared_entity_specs.rb b/spec/support/shared_entity_specs.rb
index 0ff8cae..fc0bf67 100644
--- a/spec/support/shared_entity_specs.rb
+++ b/spec/support/shared_entity_specs.rb
@@ -107,8 +107,8 @@ shared_examples "a relayable Entity" do
end
it "computes correct signatures for the entity" do
- order = described_class.class_props.keys - %i(author_signature parent_author_signature parent created_at)
- signed_string = order.map {|name| data[name] }.join(";")
+ order = described_class.class_props.keys - %i(author_signature parent_author_signature parent)
+ signed_string = order.map {|name| data[name].is_a?(Time) ? data[name].iso8601 : data[name] }.join(";")
xml = instance.to_xml