mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test for slug to ID with ID is out of range
We were testing the behavior of out of range ID's on where queries but not when out of range slugs are converted to ID's.
This commit is contained in:
parent
b55b4e2edb
commit
b74256be5b
1 changed files with 4 additions and 0 deletions
|
@ -538,6 +538,10 @@ class BasicsTest < ActiveRecord::TestCase
|
|||
assert_equal Topic.find("1-meowmeow"), Topic.find(1)
|
||||
end
|
||||
|
||||
def test_out_of_range_slugs
|
||||
assert_equal [Topic.find(1)], Topic.where(id: ["1-meowmeow", "9223372036854775808-hello"])
|
||||
end
|
||||
|
||||
def test_find_by_slug_with_array
|
||||
assert_equal Topic.find([1, 2]), Topic.find(["1-meowmeow", "2-hello"])
|
||||
assert_equal "The Second Topic of the day", Topic.find(["2-hello", "1-meowmeow"]).first.title
|
||||
|
|
Loading…
Reference in a new issue