diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-17 06:23:05 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-17 06:23:05 -0800 |
commit | c56bbaaf6f6e0ba041eea542da9a23d18edc2715 (patch) | |
tree | 6aa9612e12e0ba7d2eb6a95a88943cd865a7cd59 | |
parent | 998550396f1911d830a8d52f71972030064a1a9e (diff) | |
parent | 687cd75fb5860ddf33c7ab5ee2e0f0c5d772acec (diff) | |
download | rails-c56bbaaf6f6e0ba041eea542da9a23d18edc2715.tar.gz rails-c56bbaaf6f6e0ba041eea542da9a23d18edc2715.tar.bz2 rails-c56bbaaf6f6e0ba041eea542da9a23d18edc2715.zip |
Merge pull request #13343 from akshay-vishnoi/test-cases
test case for #limit added - picking latest value from limit
-rw-r--r-- | activerecord/test/cases/base_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index cde188f6c3..cb8e564da1 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -121,6 +121,10 @@ class BasicsTest < ActiveRecord::TestCase assert_equal 1, Topic.limit(1).to_a.length end + def test_limit_should_take_value_from_latest_limit + assert_equal 1, Topic.limit(2).limit(1).to_a.length + end + def test_invalid_limit assert_raises(ArgumentError) do Topic.limit("asdfadf").to_a |