diff options
author | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2013-12-17 03:50:34 +0530 |
---|---|---|
committer | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2013-12-17 03:50:34 +0530 |
commit | 687cd75fb5860ddf33c7ab5ee2e0f0c5d772acec (patch) | |
tree | 864c767e9c9b46d8914a449f95ba1d0561d35221 /activerecord | |
parent | 0dea33f770305f32ed7476f520f7c1ff17434fdc (diff) | |
download | rails-687cd75fb5860ddf33c7ab5ee2e0f0c5d772acec.tar.gz rails-687cd75fb5860ddf33c7ab5ee2e0f0c5d772acec.tar.bz2 rails-687cd75fb5860ddf33c7ab5ee2e0f0c5d772acec.zip |
test case for #limit added - picking latest value from limit
Diffstat (limited to 'activerecord')
-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 |