Refactor comment integration specs
This commit is contained in:
parent
deed1c3f3e
commit
9f3291f281
1 changed files with 25 additions and 25 deletions
|
|
@ -63,7 +63,7 @@ KEY
|
|||
)
|
||||
}
|
||||
|
||||
let(:legacy_comment_xml_alice) { <<-XML }
|
||||
let(:legacy_format_comment_xml_alice) { <<-XML }
|
||||
<XML>
|
||||
<post>
|
||||
<comment>
|
||||
|
|
@ -77,7 +77,7 @@ KEY
|
|||
</post>
|
||||
</XML>
|
||||
XML
|
||||
let(:new_signature_comment_xml_alice) { <<-XML }
|
||||
let(:new_format_comment_xml_alice) { <<-XML }
|
||||
<comment>
|
||||
<author>alice@pod-a.org</author>
|
||||
<guid>e21589b0b41101333b870f77ba60fa73</guid>
|
||||
|
|
@ -99,7 +99,7 @@ XML
|
|||
</comment>
|
||||
XML
|
||||
|
||||
let(:legacy_comment_xml_bob) { <<-XML }
|
||||
let(:legacy_format_comment_xml_bob) { <<-XML }
|
||||
<XML>
|
||||
<post>
|
||||
<comment>
|
||||
|
|
@ -113,7 +113,7 @@ XML
|
|||
</post>
|
||||
</XML>
|
||||
XML
|
||||
let(:legacy_signature_comment_xml_bob) { <<-XML }
|
||||
let(:legacy_order_new_format_comment_xml_bob) { <<-XML }
|
||||
<comment>
|
||||
<guid>e21589b0b41101333b870f77ba60fa73</guid>
|
||||
<parent_guid>9e269ae0b41201333b8c0f77ba60fa73</parent_guid>
|
||||
|
|
@ -123,7 +123,7 @@ XML
|
|||
<parent_author_signature>QqWSdwpb+/dcJUxuKKVe7aiz1NivXzlIdWZ71xyrxnhFxFYd+7EIittyTcp1cVehjg96pwDbn++P/rWyCffqenWu025DHvUfSmQkC93Z0dX6r3OIUlZqwEggtOdbunybiE++F3BVsGt5wC4YbAESB5ZFuhFVhBXh1X+EaZ/qoKo=</parent_author_signature>
|
||||
</comment>
|
||||
XML
|
||||
let(:legacy_new_signature_comment_xml_bob) { <<-XML }
|
||||
let(:new_order_legacy_format_comment_xml_bob) { <<-XML }
|
||||
<XML>
|
||||
<post>
|
||||
<comment>
|
||||
|
|
@ -137,7 +137,7 @@ XML
|
|||
</post>
|
||||
</XML>
|
||||
XML
|
||||
let(:new_signature_comment_xml_bob) { <<-XML }
|
||||
let(:new_format_comment_xml_bob) { <<-XML }
|
||||
<comment>
|
||||
<author>alice@pod-a.org</author>
|
||||
<guid>e21589b0b41101333b870f77ba60fa73</guid>
|
||||
|
|
@ -147,7 +147,7 @@ XML
|
|||
<parent_author_signature>hWsagsczmZD6d36d6MFdTt3hKAdnRtupSIU6464G2kkMJ+WlExxMgbF6kWR+jVCBTeKipWCYK3Arnj0YkuIZM9d14bJGVMTsW/ZzNfJ69bXZhsyawI8dPnZnLVydo+hU/XmGJBEuh2TOj9Emq6/HCYiWzPTF5qhYAtyJ1oxJ4Yk=</parent_author_signature>
|
||||
</comment>
|
||||
XML
|
||||
let(:legacy_new_data_comment_xml_bob) { <<-XML }
|
||||
let(:legacy_format_new_data_comment_xml_bob) { <<-XML }
|
||||
<XML>
|
||||
<post>
|
||||
<comment>
|
||||
|
|
@ -200,19 +200,19 @@ XML
|
|||
expect_callback(:fetch_related_entity, "Post", parent_guid).and_return(parent)
|
||||
end
|
||||
|
||||
it "relays legacy signatures and xml" do
|
||||
xml = Nokogiri::XML(legacy_comment_xml_alice).root
|
||||
it "relays legacy order" do
|
||||
xml = Nokogiri::XML(legacy_format_comment_xml_alice).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
expect(entity.to_xml.to_xml).to eq(legacy_signature_comment_xml_bob.strip)
|
||||
expect(entity.to_xml.to_xml).to eq(legacy_order_new_format_comment_xml_bob.strip)
|
||||
end
|
||||
|
||||
it "relays new signatures and xml" do
|
||||
xml = Nokogiri::XML(new_signature_comment_xml_alice).root
|
||||
it "relays new order" do
|
||||
xml = Nokogiri::XML(new_format_comment_xml_alice).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
expect(entity.to_xml.to_xml).to eq(new_signature_comment_xml_bob.strip)
|
||||
expect(entity.to_xml.to_xml).to eq(new_format_comment_xml_bob.strip)
|
||||
end
|
||||
|
||||
it "relays new signatures with new data" do
|
||||
it "relays new data" do
|
||||
xml = Nokogiri::XML(new_data_comment_xml_alice).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
expect(entity.to_xml.to_xml).to eq(new_data_comment_xml_bob.strip)
|
||||
|
|
@ -228,40 +228,40 @@ XML
|
|||
expect_callback(:fetch_related_entity, "Post", parent_guid).and_return(parent)
|
||||
end
|
||||
|
||||
it "parses legacy signatures and xml" do
|
||||
xml = Nokogiri::XML(legacy_comment_xml_bob).root
|
||||
it "parses legacy format" do
|
||||
xml = Nokogiri::XML(legacy_format_comment_xml_bob).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
|
||||
expect(entity.author).to eq(author)
|
||||
expect(entity.text).to eq(text)
|
||||
end
|
||||
|
||||
it "parses legacy signatures and with new xml" do
|
||||
xml = Nokogiri::XML(legacy_signature_comment_xml_bob).root
|
||||
it "parses legacy order with new xml format" do
|
||||
xml = Nokogiri::XML(legacy_order_new_format_comment_xml_bob).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
|
||||
expect(entity.author).to eq(author)
|
||||
expect(entity.text).to eq(text)
|
||||
end
|
||||
|
||||
it "parses new signatures with legacy xml" do
|
||||
xml = Nokogiri::XML(legacy_new_signature_comment_xml_bob).root
|
||||
it "parses new order with legacy xml format" do
|
||||
xml = Nokogiri::XML(new_order_legacy_format_comment_xml_bob).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
|
||||
expect(entity.author).to eq(author)
|
||||
expect(entity.text).to eq(text)
|
||||
end
|
||||
|
||||
it "parses new signatures and xml" do
|
||||
xml = Nokogiri::XML(new_signature_comment_xml_bob).root
|
||||
it "parses new xml format" do
|
||||
xml = Nokogiri::XML(new_format_comment_xml_bob).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
|
||||
expect(entity.author).to eq(author)
|
||||
expect(entity.text).to eq(text)
|
||||
end
|
||||
|
||||
it "parses new data with legacy xml" do
|
||||
xml = Nokogiri::XML(legacy_new_data_comment_xml_bob).root
|
||||
it "parses new data with legacy xml format" do
|
||||
xml = Nokogiri::XML(legacy_format_new_data_comment_xml_bob).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
|
||||
expect(entity.author).to eq(author)
|
||||
|
|
@ -269,7 +269,7 @@ XML
|
|||
expect(entity.additional_data["new_data"]).to eq(new_data)
|
||||
end
|
||||
|
||||
it "parses new xml with additional data" do
|
||||
it "parses new data with new xml format" do
|
||||
xml = Nokogiri::XML(new_data_comment_xml_bob).root
|
||||
entity = Salmon::XmlPayload.unpack(xml)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue