mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Only use subclasses of ActiveModel::Serializer during lookup.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user