Created
September 18, 2012 22:03
-
-
Save benhamill/3746223 to your computer and use it in GitHub Desktop.
Gists for this blog post: http://inside.oib.com/writing-readable-rspec-examples/
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
describe User do | |
describe "#serialize_comments" do | |
before do | |
subject.stub(:read_comment_count).and_return(3) | |
subject.stub(:unread_comment_count).and_return(5) | |
end | |
it "does something when there are 5 unread comments" | |
end | |
end |
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
describe User do | |
describe "permissions" do | |
context "super user" do | |
it "can see some widget" | |
end | |
end | |
end |
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
describe User do | |
describe "#serialize_comments" do | |
context "when there are 5 unread comments" do | |
before do | |
subject.stub(:read_comment_count).and_return(3) | |
subject.stub(:unread_comment_count).and_return(5) | |
end | |
it "does something when there are 5 unread comments" | |
end | |
end | |
end |
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
describe User do | |
describe "#allowed?" do | |
context "as a super user" do | |
it "can see some widget" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment