Skip to content

Instantly share code, notes, and snippets.

@larrywright
Created April 21, 2009 02:38
Show Gist options
  • Save larrywright/98899 to your computer and use it in GitHub Desktop.
Save larrywright/98899 to your computer and use it in GitHub Desktop.
class UserTest < Test::Unit::TestCase
context "A User instance" do
setup do
@user = User.find(:first)
end
should "return its full name" do
assert_equal 'John Doe', @user.full_name
end
context "with a profile" do
setup do
@user.profile = Profile.find(:first)
end
should "return true when sent #has_profile?" do
assert @user.has_profile?
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment