mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Added test case for association propagating options
This commit is contained in:
@@ -21,6 +21,9 @@ module ActiveModel
|
||||
serialization_options[:force_the_description]
|
||||
end
|
||||
end
|
||||
|
||||
@category = Category.new({name: 'Category 1'})
|
||||
@category_serializer = CategorySerializer.new(@category)
|
||||
end
|
||||
|
||||
def test_filtered_attributes_serialization
|
||||
@@ -29,6 +32,11 @@ module ActiveModel
|
||||
'profile' => { name: 'Name 1', description: forced_description }
|
||||
}, @profile_serializer.as_json(force_the_description: forced_description))
|
||||
end
|
||||
|
||||
def test_filtered_attributes_serialization_across_association
|
||||
assert_equal("'T1'",
|
||||
@category_serializer.as_json(highlight_keyword: 'T1')['category'][:posts][0][:title])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user