Fixed a documentation error regarding adapter key constant, added tests

for SerializableResource::use_adapter?
This commit is contained in:
bobba surendranath chowdary
2016-02-06 23:10:51 +05:30
parent f32c0d97d5
commit 68f09e59c4
4 changed files with 12 additions and 3 deletions

View File

@@ -23,5 +23,13 @@ module ActiveModel
options = nil
assert_equal @adapter.as_json(options), @serializable_resource.as_json(options)
end
def test_use_adapter_with_adapter_option
assert ActiveModel::SerializableResource.new(@resource, { adapter: 'json' }).use_adapter?
end
def test_use_adapter_with_adapter_option_as_false
refute ActiveModel::SerializableResource.new(@resource, { adapter: false }).use_adapter?
end
end
end