1
0
Fork 0
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:
Sean Griffin 2014-11-01 17:55:23 -06:00
parent 4b53415295
commit 3ba9d32c6c

View file

@ -522,6 +522,10 @@ class BasicsTest < ActiveRecord::TestCase
assert_equal Topic.find(['1-meowmeow', '2-hello']), Topic.find([1, 2])
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
assert_not_equal Topic.new, Topic.new
assert_equal false, Topic.new == Topic.new