engine/spec/models/site_spec.rb
2010-04-09 11:23:41 +02:00

24 lines
525 B
Ruby

require 'spec_helper'
describe Site do
it 'should have a valid factory' do
Factory.build(:site).should be_valid
end
## Validations ##
it 'should validate presence of name' do
site = Factory.build(:site, :name => nil)
site.should_not be_valid
site.errors[:name].should == ["can't be blank"]
end
it 'should have a domain at minimum' do
site = Factory.build(:site, :subdomain => nil)
site.should_not be_valid
site.domains = %w{acme.net}
site.should be_valid
end
end