Skip to content

Instantly share code, notes, and snippets.

@jaysonrowe
Created September 7, 2011 21:33
Show Gist options
  • Save jaysonrowe/1201816 to your computer and use it in GitHub Desktop.
Save jaysonrowe/1201816 to your computer and use it in GitHub Desktop.
describe User do
before(:each) do
@attr = { :name => "Example User", :email => "user@example.com" }
end
.
.
.
it "should reject names that are too long" do
long_name = "a" * 51
long_name_user = User.new(@attr.merge(:name => long_name))
long_name_user.should_not be_valid
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment