Created
October 29, 2013 00:28
-
-
Save murdoch/7207237 to your computer and use it in GitHub Desktop.
Rspec "expect" snippets found on Stackoverflow
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
expect { thing.destroy }.to change(Thing, :count).from(1).to(0) | |
expect { thing.tax = 5 }.to change { thing.total_price }.by(5) | |
expect { thing.save! }.to raise_error | |
expect { thing.symbolize_name }.to change { thing.name }.from(String).to(Symbol) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment