Sha256: 12979872c94d898addd6ff8e0a00391f34b669b6421a9cdb79cd31ae33fecc2d
Contents?: true
Size: 695 Bytes
Versions: 17
Compression:
Stored size: 695 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe Layout do dataset :layouts test_helper :validations before :each do @layout = @model = Layout.new(layout_params) end it 'should validate presence of' do assert_valid :name, 'Just a Test' assert_invalid :name, 'required', nil, '', ' ' end it 'should validate uniqueness of' do assert_invalid :name, 'name already in use', 'Main' assert_valid :name, 'Something Else' end it 'should validate length of' do { :name => 100 }.each do |field, max| assert_invalid field, ('%d-character limit' % max), 'x' * (max + 1) assert_valid field, 'x' * max end end end
Version data entries
17 entries across 17 versions & 3 rubygems