aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/type
diff options
context:
space:
mode:
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