Skip to content

Instantly share code, notes, and snippets.

@benhamill
Created September 18, 2012 22:03
Show Gist options
  • Save benhamill/3746223 to your computer and use it in GitHub Desktop.
Save benhamill/3746223 to your computer and use it in GitHub Desktop.
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
describe User do
describe "permissions" do
context "super user" do
it "can see some widget"
end
end
end
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
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