Adjusts JsonApi adapter to serialize relationships in a nested relationships hash

This commit is contained in:
Benedikt Deicke
2015-05-21 16:35:35 +02:00
parent ca41901fb8
commit 4f576a1463
9 changed files with 150 additions and 150 deletions

View File

@@ -30,9 +30,9 @@ module ActiveModel
end
def test_includes_bio_id
expected = { linkage: { type: "bios", id: "43" } }
expected = { data: { type: "bios", id: "43" } }
assert_equal(expected, @adapter.serializable_hash[:data][:links][:bio])
assert_equal(expected, @adapter.serializable_hash[:data][:relationships][:bio])
end
def test_includes_linked_bio
@@ -46,8 +46,8 @@ module ActiveModel
content:"AMS Contributor",
rating: nil
},
links: {
author: { linkage: { type: "authors", id: "1" } }
relationships: {
author: { data: { type: "authors", id: "1" } }
}
}
]