active_model_serializers/test/adapter/simple_adapter_test.rb
Tema Bolshakov f00fe5595d * Rename NullAdapter to SimpleAdapter
* Introduce abstract Adapter class
* Organaze test structure to match convemtions
2014-08-27 08:21:08 +04:00

25 lines
583 B
Ruby

require 'test_helper'
module ActiveModel
class Serializer
class Adapter
class SimpleAdapterTest < Minitest::Test
def setup
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
@profile_serializer = ProfileSerializer.new(@profile)
@adapter = SimpleAdapter.new(@profile_serializer)
end
def test_simple_adapter
assert_equal('{"name":"Name 1","description":"Description 1"}',
@adapter.to_json)
JSON
end
end
end
end
end