2010-05-02 23:33:17 +00:00
|
|
|
require 'spec_helper'
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-02 23:33:17 +00:00
|
|
|
describe LiquidTemplate do
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-02 23:33:17 +00:00
|
|
|
it 'should have a valid factory' do
|
|
|
|
Factory.build(:liquid_template).should be_valid
|
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-02 23:33:17 +00:00
|
|
|
# Validations ##
|
2010-07-23 20:09:54 +00:00
|
|
|
|
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
|
|
|
|
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|