Created
January 19, 2014 21:54
-
-
Save phiggins/8511474 to your computer and use it in GitHub Desktop.
This file contains 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
require 'spec_helper' | |
describe User do | |
it "should blow up" do | |
expect(User).to receive(:create!).and_raise(ActiveRecord::RecordNotUnique) | |
end | |
end | |
=begin | |
Fails with: | |
$ rspec spec/models/user_spec.rb | |
F | |
Failures: | |
1) User should blow up | |
Failure/Error: expect(User).to receive(:create!).and_raise(ActiveRecord::RecordNotUnique) | |
ArgumentError: | |
wrong number of arguments (0 for 2) | |
# ./spec/models/user_spec.rb:5:in `block (2 levels) in <top (required)>' | |
Finished in 0.00639 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/models/user_spec.rb:4 # User should blow up | |
Randomized with seed 58760 | |
=end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment