aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/type
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-01-01 10:00:08 -0700
committerSean Griffin <sean@thoughtbot.com>2015-01-01 10:00:08 -0700
commit19537ecd0fcc888842a49007187c371fcb454d11 (patch)
tree95cf901e0085bfe3f6fffd09bb95dacfae552546 /activerecord/test/cases/type
parent03f6e235a32b4ba540db11586b66416e780bc3d7 (diff)
downloadrails-19537ecd0fcc888842a49007187c371fcb454d11.tar.gz
rails-19537ecd0fcc888842a49007187c371fcb454d11.tar.bz2
rails-19537ecd0fcc888842a49007187c371fcb454d11.zip
Stop relying on columns in sqlite quoting tests
The string encoding test wasn't using the types for anything. The boolean casting test included logic that should be in the tests for the types, and the string test was legitimately not testing anything useful.
Diffstat (limited to 'activerecord/test/cases/type')
-rw-r--r--activerecord/test/cases/type/integer_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/type/integer_test.rb b/activerecord/test/cases/type/integer_test.rb
index af4d0b4642..ff956b7680 100644
--- a/activerecord/test/cases/type/integer_test.rb
+++ b/activerecord/test/cases/type/integer_test.rb
@@ -41,6 +41,12 @@ module ActiveRecord
assert_nil type.type_cast_from_user(1.0/0.0)
end
+ test "casting booleans for database" do
+ type = Type::Integer.new
+ assert_equal 1, type.type_cast_for_database(true)
+ assert_equal 0, type.type_cast_for_database(false)
+ end
+
test "changed?" do
type = Type::Integer.new