Skip to content

Instantly share code, notes, and snippets.

@cyx
Created March 1, 2010 02:28
Show Gist options
  • Save cyx/318023 to your computer and use it in GitHub Desktop.
Save cyx/318023 to your computer and use it in GitHub Desktop.
describe Item do
it { should validate_presence_of(:name) }
it { should validate_presence_of(:price_in_dollars) }
it { should validate_numericality_of(:price_in_dollars, :allow_blank => true) }
it { should validate_attachment_presence(:photo) }
it { should validate_length_of(:name, :maximum => 255) }
it { should belong_to(:user) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment