Created
August 8, 2012 18:05
-
-
Save dpetersen/3297119 to your computer and use it in GitHub Desktop.
User spec with implicit subject
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
describe User do | |
describe "#can_do_dangerous_stuff?" do | |
subject { user.can_do_dangerous_stuff? } | |
context "when the User is a customer" do | |
let(:user) { User.new("customer") } | |
it { should be_false } | |
end | |
context "when the User is an admin" do | |
let(:user) { User.new("admin") } | |
it { should be_true } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment