mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
- ActiveModelSerializers::JsonPointer - ActiveModel::Serializer::Adapter::JsonApi::Error - ActiveModel::Serializer::Adapter::JsonApi::Error.attributes - Fix rubocop config
21 lines
572 B
Ruby
21 lines
572 B
Ruby
require 'test_helper'
|
|
|
|
class ActiveModelSerializers::JsonPointerTest < ActiveSupport::TestCase
|
|
def test_attribute_pointer
|
|
attribute_name = 'title'
|
|
pointer = ActiveModelSerializers::JsonPointer.new(:attribute, attribute_name)
|
|
assert_equal '/data/attributes/title', pointer
|
|
end
|
|
|
|
def test_primary_data_pointer
|
|
pointer = ActiveModelSerializers::JsonPointer.new(:primary_data)
|
|
assert_equal '/data', pointer
|
|
end
|
|
|
|
def test_unkown_data_pointer
|
|
assert_raises(TypeError) do
|
|
ActiveModelSerializers::JsonPointer.new(:unknown)
|
|
end
|
|
end
|
|
end
|