aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-01 17:55:23 -0600
committerSean Griffin <sean@thoughtbot.com>2014-11-01 17:55:23 -0600
commit3ba9d32c6cb7e288ae6473298673bf1f2797f846 (patch)
tree05febda3250368efedf684055471eb7ea63c645f /activerecord/test/cases/base_test.rb
parent4b534152951fe9b1af8a1d3311da766e1d42392a (diff)
downloadrails-3ba9d32c6cb7e288ae6473298673bf1f2797f846.tar.gz
rails-3ba9d32c6cb7e288ae6473298673bf1f2797f846.tar.bz2
rails-3ba9d32c6cb7e288ae6473298673bf1f2797f846.zip
Add a test case for range type casting
We support this behavior, but have no tests which assert that type casting actually occurs.
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r--activerecord/test/cases/base_test.rb4
1 files changed, 4 insertions, 0 deletions
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