title: Testing after_hook with Rspec
body: <p>I have tag system and field for auto incrementing questions count, that belongs to tag. I am using Mongoid.</p>
  
  <p>Question model:</p>
  
  <pre><code>class Question
  
   has_and_belongs_to_many :tags, after_add: :increment_tag_count, after_remove: :decrement_tag_count
   after_destroy :dec_tags_count
   ...
   private
    def dec_tags_count
      tags.each do |tag|
        tag.dec_questions_count
      end
    end
  </code></pre>
  
  <p>and Tag model:</p>
  
  <pre><code>class Tag
    field :questions_count, type: Integer,default: 0
    has_and_belongs_to_many :questions
  
   def inc_questions_count
      inc(questions_count: 1)
    end
  
    def dec_questions_count
      inc(questions_count: -1)
    end
  </code></pre>
  
  <p>It works fine when I am testing it in browser by hand,it increments and decrements tag.questions_count field when adding or removing tags, but my test for Question model after_destroy hook always fall.</p>
  
  <pre><code>   it 'decrement tag count after destroy' do
        q = Question.create(title: 'Some question', body: "Some body", tag_list: 'sea')
        tag = Tag.where(name: 'Sea').first
        tag.questions_count.should == 1
        q.destroy
        tag.questions_count.should == 0
     end
  
  expected: 0
       got: 1 (using ==)
       it {
      #I`ve tried
      expect{ q.destroy }.to change(tag, :questions_count).by(-1)
      }
     #questions_count should have been changed by -1, but was changed by 0 
  </code></pre>
  
  <p>need help...</p>