mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
commit
bbcadec96a
@ -66,7 +66,7 @@ module ActiveModel
|
|||||||
end
|
end
|
||||||
|
|
||||||
# @api private
|
# @api private
|
||||||
# maps attribute value to explict key name
|
# maps attribute value to explicit key name
|
||||||
# @see Serializer::attribute
|
# @see Serializer::attribute
|
||||||
# @see FragmentCache#fragment_serializer
|
# @see FragmentCache#fragment_serializer
|
||||||
def _attributes_keys
|
def _attributes_keys
|
||||||
|
|||||||
@ -14,10 +14,10 @@ module ActionController
|
|||||||
{ source: { pointer: '/data/attributes/id' }, detail: 'must be a uuid' }
|
{ source: { pointer: '/data/attributes/id' }, detail: 'must be a uuid' }
|
||||||
]
|
]
|
||||||
}.to_json
|
}.to_json
|
||||||
assert_equal json_reponse_body.to_json, expected_errors_object
|
assert_equal json_response_body.to_json, expected_errors_object
|
||||||
end
|
end
|
||||||
|
|
||||||
def json_reponse_body
|
def json_response_body
|
||||||
JSON.load(@response.body)
|
JSON.load(@response.body)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -456,7 +456,7 @@ module ActionController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_render_event_is_emmited
|
def test_render_event_is_emitted
|
||||||
subscriber = ::ActiveSupport::Notifications.subscribe('render.active_model_serializers') do |name|
|
subscriber = ::ActiveSupport::Notifications.subscribe('render.active_model_serializers') do |name|
|
||||||
@name = name
|
@name = name
|
||||||
end
|
end
|
||||||
|
|||||||
@ -13,7 +13,7 @@ module ActiveModelSerializers
|
|||||||
assert_equal '/data', pointer
|
assert_equal '/data', pointer
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_unkown_data_pointer
|
def test_unknown_data_pointer
|
||||||
assert_raises(TypeError) do
|
assert_raises(TypeError) do
|
||||||
ActiveModelSerializers::JsonPointer.new(:unknown)
|
ActiveModelSerializers::JsonPointer.new(:unknown)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user