Last active
December 25, 2015 23:09
-
-
Save sri/7055372 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
# From http://betterspecs.org/: | |
# For instance methods, use: "#instance_method?" | |
describe ".class_method" do | |
# Start context description using "when" or "with". | |
# Keep it under 40 characters; if longer | |
# break it up using "context". When run, it should | |
# output in a readable format. | |
context "when logged in" do | |
# Use new rspec syntax. Don't use | |
# should! Also, each spec should make | |
# only one assertion (unless it doing | |
# something heavier). | |
it { expect(response).to respond_with 200 } | |
end | |
end | |
# Other tips: | |
# - test all the edge cases. | |
# - don't use: it "should ..." description | |
# in your specs | |
# - use let, let! instead of create instance vars | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment