aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/types/unknown_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-23 22:53:26 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-23 22:53:26 +0100
commitf915f9e33903ee474920e24ad12a1625f2ef1c52 (patch)
tree5b6d41e8a809aeaadbc2c0be59603f5f58b16231 /activerecord/test/cases/types/unknown_test.rb
parentb17e358e3df34c03019e357f693611618092e1d6 (diff)
parent8ff2fb6f3aa6140f5a8bd018d5919a8a1e707cda (diff)
downloadrails-f915f9e33903ee474920e24ad12a1625f2ef1c52.tar.gz
rails-f915f9e33903ee474920e24ad12a1625f2ef1c52.tar.bz2
rails-f915f9e33903ee474920e24ad12a1625f2ef1c52.zip
Merge branch 'master' into app
Conflicts: railties/lib/rails/application.rb
Diffstat (limited to 'activerecord/test/cases/types/unknown_test.rb')
-rw-r--r--activerecord/test/cases/types/unknown_test.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/activerecord/test/cases/types/unknown_test.rb b/activerecord/test/cases/types/unknown_test.rb
deleted file mode 100644
index 230d67b2fb..0000000000
--- a/activerecord/test/cases/types/unknown_test.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require "cases/helper"
-
-class UnknownTest < ActiveRecord::TestCase
-
- test "typecast attributes does't modify values" do
- unkown = ActiveRecord::Type::Unknown.new
- person = { 'name' => '0' }
-
- assert_equal person['name'], unkown.cast(person['name'])
- assert_equal person['name'], unkown.precast(person['name'])
- end
-
- test "cast as boolean" do
- person = { 'id' => 0, 'name' => ' ', 'admin' => 'false', 'votes' => '0' }
- unkown = ActiveRecord::Type::Unknown.new
-
- assert_equal false, unkown.boolean(person['votes'])
- assert_equal false, unkown.boolean(person['admin'])
- assert_equal false, unkown.boolean(person['name'])
- assert_equal false, unkown.boolean(person['id'])
-
- person = { 'id' => 5, 'name' => 'Eric', 'admin' => 'true', 'votes' => '25' }
- assert_equal true, unkown.boolean(person['votes'])
- assert_equal true, unkown.boolean(person['admin'])
- assert_equal true, unkown.boolean(person['name'])
- assert_equal true, unkown.boolean(person['id'])
- end
-
-end \ No newline at end of file