GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Rails Plugin - a RailsEngines-based CMS extension for any Rails project
Homepage: http://6brand.com
Clone URL: git://github.com/JackDanger/simple_pages.git
studioda (author)
Thu May 03 16:33:45 -0700 2007
commit  7326fd869cc618314d4d1d753d886bb648e1b571
tree    6ce209dbc6abf384b8b38f54ddb284af7cab95d1
parent  7e916de4e8ef8331789aec328110c1846abab812
simple_pages / test / simple_page_test.rb
100644 18 lines (16 sloc) 0.814 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'test/unit'
require File.expand_path(File.dirname(__FILE__) + '/../../../../config/environment')
require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper')
require File.expand_path(File.dirname(__FILE__)) + '/../app/controllers/simple_pages_controller'
 
class SimplePageTest < Test::Unit::TestCase
  def test_model_validation
    simple_page = SimplePage.create
    assert !simple_page.errors.empty?
    assert_not_nil simple_page.errors.on(:filename)
    assert_not_nil simple_page.errors.on(:title)
    simple_page.update_attributes(:filename => 'duplicate', :title => 'some title')
    simple_page = SimplePage.create(:filename => 'duplicate', :title => 'some title')
    assert_not_nil simple_page.errors.on(:filename)
    assert_not_nil simple_page.errors.on(:title)
  end
end