mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
* Rename NullAdapter to SimpleAdapter
* Introduce abstract Adapter class * Organaze test structure to match convemtions
This commit is contained in:
25
test/adapter_test.rb
Normal file
25
test/adapter_test.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require 'test_helper'
|
||||
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
class AdapterTest < Minitest::Test
|
||||
def setup
|
||||
profile = Profile.new
|
||||
serializer = ProfileSerializer.new(profile)
|
||||
@adapter = ActiveModel::Serializer::Adapter.new(serializer)
|
||||
end
|
||||
|
||||
def test_serializable_hash_is_abstract_method
|
||||
assert_raises(NotImplementedError) do
|
||||
@adapter.serializable_hash(only: [:name])
|
||||
end
|
||||
end
|
||||
|
||||
def test_serializable_hash_is_abstract_method
|
||||
assert_raises(NotImplementedError) do
|
||||
@adapter.to_json(only: [:name])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user