Sha256: d97ba8ac72797613970d17c18bc15ce8dec5a70f8f8a26a96a92720696801f34

Contents?: true

Size: 615 Bytes

Versions: 8

Compression:

Stored size: 615 Bytes

Contents

require 'test_helper'

module ActiveModelSerializers
  class 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_unknown_data_pointer
      assert_raises(TypeError) do
        ActiveModelSerializers::JsonPointer.new(:unknown)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
active_model_serializers-0.10.8 test/active_model_serializers/json_pointer_test.rb
active_model_serializers-0.10.7 test/active_model_serializers/json_pointer_test.rb
active_model_serializers-0.10.6 test/active_model_serializers/json_pointer_test.rb
active_model_serializers-0.10.5 test/active_model_serializers/json_pointer_test.rb
active_model_serializers-0.10.4 test/active_model_serializers/json_pointer_test.rb
agi_active_model_serializers-0.10.9 test/active_model_serializers/json_pointer_test.rb
agi_active_model_serializers-0.10.8 test/active_model_serializers/json_pointer_test.rb
agi_active_model_serializers-0.10.7 test/active_model_serializers/json_pointer_test.rb