Merge pull request #23 from indieweb/add-spec-for-p-h-foo
Add spec for nested format with property of same name
This commit is contained in:
commit
1a3f86f797
3 changed files with 43 additions and 0 deletions
|
@ -138,6 +138,20 @@ describe Microformats2::Collection do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "nested-format-with-property-of-same-name.html" do
|
||||||
|
before do
|
||||||
|
html = "spec/support/lib/microformats2/nested-format-with-property-of-same-name.html"
|
||||||
|
@collection = Microformats2.parse(html)
|
||||||
|
end
|
||||||
|
describe "#to_json" do
|
||||||
|
it "should match nested-format-with-property-of-same-name.js" do
|
||||||
|
json = "spec/support/lib/microformats2/nested-format-with-property-of-same-name.js"
|
||||||
|
json = open(json).read
|
||||||
|
JSON.parse(@collection.to_json).should == JSON.parse(json)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "nested-format-with-property.html" do
|
describe "nested-format-with-property.html" do
|
||||||
before do
|
before do
|
||||||
html = "spec/support/lib/microformats2/nested-format-with-property.html"
|
html = "spec/support/lib/microformats2/nested-format-with-property.html"
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<div class="h-card">
|
||||||
|
<div class="p-adr h-adr">
|
||||||
|
<span class="p-street-address">
|
||||||
|
123 Rainbow Lane
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ "items": [{
|
||||||
|
"type": ["h-card"],
|
||||||
|
"properties": {
|
||||||
|
"adr": [{
|
||||||
|
"value": "123 Rainbow Lane",
|
||||||
|
"type": ["h-adr"],
|
||||||
|
"properties": {
|
||||||
|
"street-address": ["123 Rainbow Lane"],
|
||||||
|
"name": ["123 Rainbow Lane"]
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"name": ["123 Rainbow Lane"]
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
"rels": {}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue