diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-06-12 18:50:24 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-06-12 18:50:24 +0100 |
commit | c52520166be48299b589dbccd7d1ee22b1095ffb (patch) | |
tree | 40fe77cfafd7de58a60ca0b72b5445f3301cada2 /activerecord/test/cases | |
parent | 232c66a1ba3c683655856d277b7227faa37fb8c3 (diff) | |
download | rails-c52520166be48299b589dbccd7d1ee22b1095ffb.tar.gz rails-c52520166be48299b589dbccd7d1ee22b1095ffb.tar.bz2 rails-c52520166be48299b589dbccd7d1ee22b1095ffb.zip |
Make assert_no_queries literally enforce that there are no queries. As in, not a single line of SQL should be sent to the database, not even stuff that is ignored by assert_queries. The argument being that if you write assert_no_queries, you really do not want there to be any queries.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index e16a573a1f..9af1f7249f 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -550,15 +550,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end def test_transactions_when_adding_to_new_record - prev_ignored_sql = ActiveRecord::SQLCounter.ignored_sql - ActiveRecord::SQLCounter.ignored_sql = [] - assert_no_queries do firm = Firm.new firm.clients_of_firm.concat(Client.new("name" => "Natural Company")) end - ensure - ActiveRecord::SQLCounter.ignored_sql = prev_ignored_sql end def test_new_aliased_to_build @@ -817,17 +812,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end def test_transaction_when_deleting_new_record - prev_ignored_sql = ActiveRecord::SQLCounter.ignored_sql - ActiveRecord::SQLCounter.ignored_sql = [] - assert_no_queries do firm = Firm.new client = Client.new("name" => "New Client") firm.clients_of_firm << client firm.clients_of_firm.destroy(client) end - ensure - ActiveRecord::SQLCounter.ignored_sql = prev_ignored_sql end def test_clearing_an_association_collection @@ -1178,15 +1168,10 @@ class HasManyAssociationsTest < ActiveRecord::TestCase end def test_transactions_when_replacing_on_new_record - prev_ignored_sql = ActiveRecord::SQLCounter.ignored_sql - ActiveRecord::SQLCounter.ignored_sql = [] - assert_no_queries do firm = Firm.new firm.clients_of_firm = [Client.new("name" => "New Client")] end - ensure - ActiveRecord::SQLCounter.ignored_sql = prev_ignored_sql end def test_get_ids |