Created
February 17, 2011 17:54
-
-
Save rud/832250 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 "with a bit of state" do | |
| let!(:user) { User.create! } | |
| it "should be the latest user" do | |
| User.last.should == user | |
| end | |
| # .. more examples reusing the user | |
| 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
| context "with a bit of state" do | |
| before :each do | |
| @user = User.create! | |
| end | |
| # The following specs assume the user has already been created | |
| it "should be the latest user" do | |
| User.last.should == @user | |
| end | |
| # .. more examples reusing the @user | |
| 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
| context "with a bit of state" do | |
| let(:user) { User.create! } | |
| before :each do | |
| user | |
| end | |
| # The following specs assume the user has already been created | |
| it "should be the latest user" do | |
| User.last.should == user | |
| end | |
| # .. more examples reusing the user | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment