Skip to content

Instantly share code, notes, and snippets.

@rud
Created February 17, 2011 17:54
Show Gist options
  • Select an option

  • Save rud/832250 to your computer and use it in GitHub Desktop.

Select an option

Save rud/832250 to your computer and use it in GitHub Desktop.
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
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
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