summaryrefslogtreecommitdiff
path: root/test/json/test_json_rails.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/json/test_json_rails.rb')
-rw-r--r--test/json/test_json_rails.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/json/test_json_rails.rb b/test/json/test_json_rails.rb
index e44ea606e3..c0447ddaba 100644
--- a/test/json/test_json_rails.rb
+++ b/test/json/test_json_rails.rb
@@ -31,6 +31,10 @@ class TC_JSONRails < Test::Unit::TestCase
end
class B
+ def self.json_creatable?
+ false
+ end
+
def to_json(*args)
{
'json_class' => self.class.name,
@@ -46,9 +50,6 @@ class TC_JSONRails < Test::Unit::TestCase
end
end
- def setup
- end
-
def test_extended_json
a = A.new(666)
assert A.json_creatable?
@@ -73,14 +74,14 @@ class TC_JSONRails < Test::Unit::TestCase
)
end
- def test_extended_json_fail
+ def test_extended_json_fail1
b = B.new
assert !B.json_creatable?
json = generate(b)
assert_equal({ 'json_class' => B.name }, JSON.parse(json))
end
- def test_extended_json_fail
+ def test_extended_json_fail2
c = C.new # with rails addition all objects are theoretically creatable
assert C.json_creatable?
json = generate(c)