Skip to content

Instantly share code, notes, and snippets.

@e1senh0rn
Created June 30, 2009 18:12
Show Gist options
  • Save e1senh0rn/138305 to your computer and use it in GitHub Desktop.
Save e1senh0rn/138305 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + '/../spec_helper'
module PropertySpecHelper
def valid_property_attributes
{
:name => "a_property",
:presentation => "A Property"
}
end
end
describe Property do
include PropertySpecHelper
it { should validate_presence_of(:name) }
it { should validate_presence_of(:presentation) }
before(:each) do
@property = Property.new
end
it "should not be valid when empty" do
@property.should_not be_valid
end
it "should be valid when having correct information" do
@property.attributes = valid_property_attributes
@property.should be_valid
end
it "should find all by prototype"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment