mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Those are config tests
This commit is contained in:
parent
c83e643edd
commit
04f8c0c16f
@ -30,7 +30,7 @@ module ActiveModel
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class SetupTest < ActiveModel::TestCase
|
class ConfigTest < ActiveModel::TestCase
|
||||||
def test_setup
|
def test_setup
|
||||||
ActiveModel::Serializer.setup do |config|
|
ActiveModel::Serializer.setup do |config|
|
||||||
config.a = 'v1'
|
config.a = 'v1'
|
||||||
@ -43,7 +43,7 @@ module ActiveModel
|
|||||||
CONFIG.clear
|
CONFIG.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_setup_config_accessors
|
def test_config_accessors
|
||||||
ActiveModel::Serializer.setup do |config|
|
ActiveModel::Serializer.setup do |config|
|
||||||
config.foo = 'v1'
|
config.foo = 'v1'
|
||||||
config.bar = 'v2'
|
config.bar = 'v2'
|
||||||
@ -55,7 +55,7 @@ module ActiveModel
|
|||||||
CONFIG.clear
|
CONFIG.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_setup_acessor_when_nil
|
def test_acessor_when_nil
|
||||||
assert_nil CONFIG.foo
|
assert_nil CONFIG.foo
|
||||||
CONFIG.foo = 1
|
CONFIG.foo = 1
|
||||||
assert_equal 1, CONFIG.foo
|
assert_equal 1, CONFIG.foo
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user