2010-05-02 23:33:17 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe LiquidTemplate do
|
|
|
|
|
|
|
|
it 'should have a valid factory' do
|
|
|
|
Factory.build(:liquid_template).should be_valid
|
|
|
|
end
|
|
|
|
|
|
|
|
# Validations ##
|
|
|
|
|
2010-05-10 22:39:52 +00:00
|
|
|
%w{site name value}.each do |field|
|
2010-05-02 23:33:17 +00:00
|
|
|
it "should validate presence of #{field}" do
|
|
|
|
template = Factory.build(:liquid_template, field.to_sym => nil)
|
|
|
|
template.should_not be_valid
|
|
|
|
template.errors[field.to_sym].should == ["can't be blank"]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|