aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
diff options
context:
space:
mode:
authorAditya Sanghi <asanghi@me.com>2010-11-29 18:13:17 +0530
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-08 15:51:47 -0800
commit7a237d56aa38c51987af0fd52d001989c4f3da07 (patch)
treed118c8bc7f9e1e4d25d2bb54d491d24899e610f3 /activerecord/test/cases/base_test.rb
parent285f456391014c6e5ce1a694d43088012fbc7772 (diff)
downloadrails-7a237d56aa38c51987af0fd52d001989c4f3da07.tar.gz
rails-7a237d56aa38c51987af0fd52d001989c4f3da07.tar.bz2
rails-7a237d56aa38c51987af0fd52d001989c4f3da07.zip
Ensure that boolean false is properly serialized [#6079 state:resolved]
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r--activerecord/test/cases/base_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index c3ba1f0c35..86d4a90fc4 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -997,6 +997,22 @@ class BasicsTest < ActiveRecord::TestCase
Topic.serialize(:content)
end
+ def test_serialized_boolean_value_true
+ Topic.serialize(:content)
+ topic = Topic.new(:content => true)
+ assert topic.save
+ topic = topic.reload
+ assert_equal topic.content, true
+ end
+
+ def test_serialized_boolean_value_false
+ Topic.serialize(:content)
+ topic = Topic.new(:content => false)
+ assert topic.save
+ topic = topic.reload
+ assert_equal topic.content, false
+ end
+
def test_quote
author_name = "\\ \001 ' \n \\n \""
topic = Topic.create('author_name' => author_name)