public
Rubygem
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
should_have_many: added tests for :source option
showaltb (author)
Tue Jul 29 07:35:14 -0700 2008
Ryan McGeary (committer)
Fri Aug 01 10:41:17 -0700 2008
commit  b0b8963075a3190310c8d0ced0fb9e72f91e8373
tree    1029eb185e7d2d5b0e308857232df418f459190f
parent  2cb29f5e6daf217299296282e753b5f0bef9ff37
...
3
4
5
 
6
7
8
...
3
4
5
6
7
8
9
0
@@ -3,6 +3,7 @@ class Post < ActiveRecord::Base
0
   belongs_to :owner, :foreign_key => :user_id, :class_name => 'User'
0
   has_many :taggings
0
   has_many :tags, :through => :taggings
0
+  has_many :through_tags, :through => :taggings, :source => :tags
0
   
0
   validates_uniqueness_of :title
0
   validates_presence_of :title
...
6
7
8
 
9
10
11
...
6
7
8
9
10
11
12
0
@@ -6,6 +6,7 @@ class PostTest < Test::Unit::TestCase
0
   should_belong_to :user
0
   should_belong_to :owner
0
   should_have_many :tags, :through => :taggings
0
+  should_have_many :through_tags, :through => :taggings
0
   
0
   should_require_unique_attributes :title
0
   should_require_attributes :body, :message => /wtf/

Comments