Created
June 25, 2010 23:08
-
-
Save lazyatom/453576 to your computer and use it in GitHub Desktop.
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
context "Given a bunch of stuff" do | |
setup do | |
@thing = Factory(:thingy) | |
@user = Factory(:user) | |
@user.register_with(@thing) | |
end | |
# THIS is the code I'm actually testing, isolated from the rest of the setup | |
action("the user activates the thing") do | |
@user.activate(@thing) | |
end | |
should_change("the thing's colour") { @thing.colour } | |
should "not allow the thing to be activated again" do | |
assert_raises(AlreadyActivated) { @user.activate(@thing) } | |
end | |
# etc... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment