mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a test case for range type casting
We support this behavior, but have no tests which assert that type casting actually occurs.
This commit is contained in:
parent
4b53415295
commit
3ba9d32c6c
1 changed files with 4 additions and 0 deletions
|
@ -522,6 +522,10 @@ class BasicsTest < ActiveRecord::TestCase
|
||||||
assert_equal Topic.find(['1-meowmeow', '2-hello']), Topic.find([1, 2])
|
assert_equal Topic.find(['1-meowmeow', '2-hello']), Topic.find([1, 2])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_find_by_slug_with_range
|
||||||
|
assert_equal Topic.where(id: '1-meowmeow'..'2-hello'), Topic.where(id: 1..2)
|
||||||
|
end
|
||||||
|
|
||||||
def test_equality_of_new_records
|
def test_equality_of_new_records
|
||||||
assert_not_equal Topic.new, Topic.new
|
assert_not_equal Topic.new, Topic.new
|
||||||
assert_equal false, Topic.new == Topic.new
|
assert_equal false, Topic.new == Topic.new
|
||||||
|
|
Loading…
Reference in a new issue