title: Deleting children does work in real app, but not in test
body: <p>I can't for the life of me figure out what's going wrong here. I have a Client model and an Invoice model.</p>
  
  <p><b>Client.rb</b></p>
  
  <pre><code>has_many :invoices, dependent: :destroy
  </code></pre>
  
  <p><b>Invoices.rb</b></p>
  
  <pre><code>belongs_to :client
  </code></pre>
  
  <p>I have the following client spec:</p>
  
  <pre><code>it "destroys its children upon destruction" do
    i = FactoryGirl.create(:invoice) # As per the factory, the :client is the parent of :invoice and is automatically created with the :invoice factory
  
    lambda {
      i.client.destroy
    }.should change(Invoice.all, :count).by(-1)
  end
  </code></pre>
  
  <p>And here are my factories:</p>
  
  <p><b>Client factory</b></p>
  
  <pre><code>FactoryGirl.define do
    factory :client do
      city "MyString"
    end
  end
  </code></pre>
  
  <p><b>Invoice factory</b></p>
  
  <pre><code>FactoryGirl.define do
    factory :invoice do
      association :client
      gross_amount 3.14
    end
  end
  </code></pre>
  
  <p>If I do <code>i = FactoryGirl.create(:invoice)</code> and afterwards <code>i.client.destroy</code> manually in the console, the invoice is in fact destroyed. But for some reason, the test fails, giving me "count should have been changed by -1, but was changed by 0".</p>
  
  <p>What am I doing wrong?</p>