public
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
showaltb (author)
Tue Jul 29 07:35:14 -0700 2008
rmm5t (committer)
Fri Aug 01 10:41:17 -0700 2008
shoulda / test / unit / post_test.rb
100644 16 lines (12 sloc) 0.451 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require File.dirname(__FILE__) + '/../test_helper'
 
class PostTest < Test::Unit::TestCase
  load_all_fixtures
 
  should_belong_to :user
  should_belong_to :owner
  should_have_many :tags, :through => :taggings
  should_have_many :through_tags, :through => :taggings
  
  should_require_unique_attributes :title
  should_require_attributes :body, :message => /wtf/
  should_require_attributes :title
  should_only_allow_numeric_values_for :user_id
end