Created
June 4, 2011 23:27
-
-
Save jackdempsey/1008487 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 describe Comment do | |
4 it "fires an event when created" do | |
5 expect { Comment.make! }.to fire_event :comment_left | |
6 end | |
7 end | |
... | |
38 RSpec::Matchers.define :fire_event do |event_type| | |
39 match do |actual| | |
40 expect(&actual).to change{TimelineEvent.count}.by(1) | |
41 end | |
42 end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment