Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_specs / test / unit / .svn / text-base / layout_test.rb.svn-base
blobd83d81074e24bb253f80014b2bf46bc02c9b5b4c
1 require File.dirname(__FILE__) + '/../test_helper'
3 class LayoutTest < Test::Unit::TestCase
4   fixtures :layouts
5   test_helper :layouts, :validations
6   
7   def setup
8     @layout = @model = Layout.new(VALID_LAYOUT_PARAMS)
9   end
10   
11   def test_validates_presence_of
12     assert_valid :name, 'Just a Test'
13     assert_invalid :name, 'required', nil, '', '  '
14   end
15   
16   def test_validates_uniqueness_of
17     assert_invalid :name, 'name already in use', 'Home Page'
18     assert_valid :name, 'Something Else'
19   end
20   
21   def test_validates_length_of
22     {
23       :name => 100
24     }.each do |field, max|
25       assert_invalid field, ('%d-character limit' % max), 'x' * (max + 1)
26       assert_valid field, 'x' * max
27     end
28   end
29 end