title: using rspec to test side-effects
body: <p>In my model <code>Passages</code> I have a method <code>receives_damage</code>:</p>
  
  <pre><code>def receives_damage
    self.damage += 1
  
    self.phrases.each do |phrase|
  
      if !phrase.blank &amp;&amp; phrase.hit_points &lt;= self.damage
        phrase.blank = true
        phrase.content = phrase.content.gsub(/./, "&amp;nbsp;")
  
        phrase.save
      end
    end
  
    self.save
  end
  </code></pre>
  
  <p>In my model specs for <code>receives_damage</code> I have:</p>
  
  <p><code>it "it increases the damage by 1"</code></p>
  
  <p><code>it "it blanks any phrases with few enough hitpoints"</code></p>
  
  <p>The first spec was easy enough to write, but in the second case I am testing a side-effect and I'm not sure how to do that.</p>
  
  <p>Thanks</p>
  
  <p>z.</p>