In my model Passages
I have a method receives_damage
:
def receives_damage
self.damage += 1
self.phrases.each do |phrase|
if !phrase.blank && phrase.hit_points <= self.damage
phrase.blank = true
phrase.content = phrase.content.gsub(/./, " ")
phrase.save
end
end
self.save
end
In my model specs for receives_damage
I have:
it "it increases the damage by 1"
it "it blanks any phrases with few enough hitpoints"
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.
Thanks
z.