From 3ba9d32c6cb7e288ae6473298673bf1f2797f846 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sat, 1 Nov 2014 17:55:23 -0600 Subject: Add a test case for range type casting We support this behavior, but have no tests which assert that type casting actually occurs. --- activerecord/test/cases/base_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 4e1685f151..3675401555 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -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 -- cgit v1.2.3