aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/type
diff options
context:
space:
mode:
authorIain Beeston <iain.beeston@gmail.com>2016-10-03 14:06:11 +0100
committerIain Beeston <iain.beeston@gmail.com>2016-10-14 20:21:20 +0100
commit994ce87bbda7cc4b0059c951b06cdd15dc26cb97 (patch)
tree64da21f688868906bf1c6548606c4cab392de416 /activerecord/test/cases/type
parent159b774887cfb3d5c862b2b48d24d75b658e47af (diff)
downloadrails-994ce87bbda7cc4b0059c951b06cdd15dc26cb97.tar.gz
rails-994ce87bbda7cc4b0059c951b06cdd15dc26cb97.tar.bz2
rails-994ce87bbda7cc4b0059c951b06cdd15dc26cb97.zip
Moved database-specific ActiveModel types into ActiveRecord
ie. DecimalWithoutScale, Text and UnsignedInteger
Diffstat (limited to 'activerecord/test/cases/type')
-rw-r--r--activerecord/test/cases/type/unsigned_integer_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/cases/type/unsigned_integer_test.rb b/activerecord/test/cases/type/unsigned_integer_test.rb
new file mode 100644
index 0000000000..1cd4dbc2c5
--- /dev/null
+++ b/activerecord/test/cases/type/unsigned_integer_test.rb
@@ -0,0 +1,17 @@
+require "cases/helper"
+
+module ActiveRecord
+ module Type
+ class UnsignedIntegerTest < ActiveRecord::TestCase
+ test "unsigned int max value is in range" do
+ assert_equal(4294967295, UnsignedInteger.new.serialize(4294967295))
+ end
+
+ test "minus value is out of range" do
+ assert_raises(ActiveModel::RangeError) do
+ UnsignedInteger.new.serialize(-1)
+ end
+ end
+ end
+ end
+end