updating tests to match new adapters structure

This commit is contained in:
João Moura
2015-06-15 13:39:36 -03:00
parent 2e46507971
commit 1ea5608e78
17 changed files with 49 additions and 43 deletions

View File

@@ -28,16 +28,16 @@ module ActiveModel
@serializer = ArraySerializer.new([@blog], serializer: CustomBlogSerializer)
@adapter = ActiveModel::Serializer::Adapter::Json.new(@serializer)
expected = [{
expected = {custom_blog:[{
id: 1,
special_attribute: "Special",
articles: [{id: 1,title: "Hello!!", body: "Hello, world!!"}, {id: 2, title: "New Post", body: "Body"}]
}]
}]}
assert_equal expected, @adapter.serializable_hash
end
def test_include_multiple_posts
expected = [{
expected = { post: [{
title: "Hello!!",
body: "Hello, world!!",
id: 1,
@@ -63,7 +63,7 @@ module ActiveModel
id: 999,
name: "Custom blog"
}
}]
}]}
assert_equal expected, @adapter.serializable_hash
end
end