diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-03-03 21:59:08 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-03 21:59:08 +0900 |
commit | e33c1f3c26ff3d2921d953d5c747cb5b90c6c1c6 (patch) | |
tree | b02e0bc5c5248775ca7481a1c3a6363589ad692a | |
parent | 67ebf49df3afad4355415a95ea9d08a39565a494 (diff) | |
parent | 417c251928fcc9bdf1dcb54dd4a75fead7c9a088 (diff) | |
download | rails-e33c1f3c26ff3d2921d953d5c747cb5b90c6c1c6.tar.gz rails-e33c1f3c26ff3d2921d953d5c747cb5b90c6c1c6.tar.bz2 rails-e33c1f3c26ff3d2921d953d5c747cb5b90c6c1c6.zip |
Merge pull request #35457 from yahonda/run_delte_all_test
Oracle database can run `delete` with `order by` and`fetch first n rows only`
-rw-r--r-- | activerecord/test/cases/relation/delete_all_test.rb | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/activerecord/test/cases/relation/delete_all_test.rb b/activerecord/test/cases/relation/delete_all_test.rb index 446d7621ea..d1c13fa1b5 100644 --- a/activerecord/test/cases/relation/delete_all_test.rb +++ b/activerecord/test/cases/relation/delete_all_test.rb @@ -80,25 +80,23 @@ class DeleteAllTest < ActiveRecord::TestCase assert_equal pets.count, pets.delete_all end - unless current_adapter?(:OracleAdapter) - def test_delete_all_with_order_and_limit_deletes_subset_only - author = authors(:david) - limited_posts = Post.where(author: author).order(:id).limit(1) - assert_equal 1, limited_posts.size - assert_equal 2, limited_posts.limit(2).size - assert_equal 1, limited_posts.delete_all - assert_raise(ActiveRecord::RecordNotFound) { posts(:welcome) } - assert posts(:thinking) - end + def test_delete_all_with_order_and_limit_deletes_subset_only + author = authors(:david) + limited_posts = Post.where(author: author).order(:id).limit(1) + assert_equal 1, limited_posts.size + assert_equal 2, limited_posts.limit(2).size + assert_equal 1, limited_posts.delete_all + assert_raise(ActiveRecord::RecordNotFound) { posts(:welcome) } + assert posts(:thinking) + end - def test_delete_all_with_order_and_limit_and_offset_deletes_subset_only - author = authors(:david) - limited_posts = Post.where(author: author).order(:id).limit(1).offset(1) - assert_equal 1, limited_posts.size - assert_equal 2, limited_posts.limit(2).size - assert_equal 1, limited_posts.delete_all - assert_raise(ActiveRecord::RecordNotFound) { posts(:thinking) } - assert posts(:welcome) - end + def test_delete_all_with_order_and_limit_and_offset_deletes_subset_only + author = authors(:david) + limited_posts = Post.where(author: author).order(:id).limit(1).offset(1) + assert_equal 1, limited_posts.size + assert_equal 2, limited_posts.limit(2).size + assert_equal 1, limited_posts.delete_all + assert_raise(ActiveRecord::RecordNotFound) { posts(:thinking) } + assert posts(:welcome) end end |