Merge pull request #1294 from beauby/fix-serializer-lookup-non-ams

Only use subclasses of ActiveModel::Serializer during lookup.
This commit is contained in:
L. Preston Sego III
2015-10-25 23:01:00 -04:00
2 changed files with 10 additions and 1 deletions

View File

@@ -44,11 +44,20 @@ module ActiveModel
def serializer_class; ProfileSerializer; end
end
Tweet = Class.new(::Model)
TweetSerializer = Class.new
def setup
@profile = Profile.new
@my_profile = MyProfile.new
@custom_profile = CustomProfile.new
@model = ::Model.new
@tweet = Tweet.new
end
def test_serializer_for_non_ams_serializer
serializer = ActiveModel::Serializer.serializer_for(@tweet)
assert_nil(serializer)
end
def test_serializer_for_existing_serializer