mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
parent
e02a136f7f
commit
a51bdd3ddc
4 changed files with 6 additions and 6 deletions
|
@ -9,7 +9,7 @@ module ActiveModel
|
|||
end
|
||||
|
||||
test "minus value is out of range" do
|
||||
assert_raises(::RangeError) do
|
||||
assert_raises(ActiveModel::RangeError) do
|
||||
UnsignedInteger.new.serialize(-1)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,10 +28,10 @@ class Mysql2UnsignedTypeTest < ActiveRecord::Mysql2TestCase
|
|||
end
|
||||
|
||||
test "minus value is out of range" do
|
||||
assert_raise(RangeError) do
|
||||
assert_raise(ActiveModel::RangeError) do
|
||||
UnsignedType.create(unsigned_integer: -10)
|
||||
end
|
||||
assert_raise(RangeError) do
|
||||
assert_raise(ActiveModel::RangeError) do
|
||||
UnsignedType.create(unsigned_bigint: -10)
|
||||
end
|
||||
assert_raise(ActiveRecord::StatementInvalid) do
|
||||
|
|
|
@ -18,7 +18,7 @@ class PostgresqlTypeLookupTest < ActiveRecord::PostgreSQLTestCase
|
|||
bigint_array = @connection.type_map.lookup(1016, -1, "bigint[]")
|
||||
big_array = [123456789123456789]
|
||||
|
||||
assert_raises(RangeError) { int_array.serialize(big_array) }
|
||||
assert_raises(ActiveModel::RangeError) { int_array.serialize(big_array) }
|
||||
assert_equal "{123456789123456789}", bigint_array.serialize(big_array)
|
||||
end
|
||||
|
||||
|
@ -27,7 +27,7 @@ class PostgresqlTypeLookupTest < ActiveRecord::PostgreSQLTestCase
|
|||
bigint_range = @connection.type_map.lookup(3926, -1, "int8range")
|
||||
big_range = 0..123456789123456789
|
||||
|
||||
assert_raises(RangeError) { int_range.serialize(big_range) }
|
||||
assert_raises(ActiveModel::RangeError) { int_range.serialize(big_range) }
|
||||
assert_equal "[0,123456789123456789]", bigint_range.serialize(big_range)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -174,7 +174,7 @@ class FinderTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
def test_exists_fails_when_parameter_has_invalid_type
|
||||
assert_raises(RangeError) do
|
||||
assert_raises(ActiveModel::RangeError) do
|
||||
assert_equal false, Topic.exists?(("9"*53).to_i) # number that's bigger than int
|
||||
end
|
||||
assert_equal false, Topic.exists?("foo")
|
||||
|
|
Loading…
Reference in a new issue