Sha256: 77b9756c85ad1bda848d79f7539e47eb6ebcd5dd67340084e22592d3bac3661b
Contents?: true
Size: 543 Bytes
Versions: 9
Compression:
Stored size: 543 Bytes
Contents
require 'test_helper' module ActiveModel class ArraySerializer class OptionsTest < Minitest::Test def test_custom_options_are_accessible_from_serializer array = [Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }), Profile.new({ name: 'Name 2', description: 'Description 2', comments: 'Comments 2' })] serializer = ArraySerializer.new(array, only: [:name], context: {foo: :bar}) assert_equal({foo: :bar}, serializer.context) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems