1 require File.dirname(__FILE__) + '/../test_helper'
3 class CommentingTest < Test::Unit::TestCase
4 fixtures :commentings, :comments, <%= commentable_models[0..1].join(", ") -%>
7 @obj1 = <%= model_two %>.find(1)
8 @obj2 = <%= model_two %>.find(2)
9 <% if commentable_models.size > 1 -%>
10 @obj3 = <%= model_one -%>.find(1)
12 @comment1 = Comment.find(1)
13 @comment2 = Comment.find(2)
14 @commenting1 = Commenting.find(1)
18 assert_raises(RuntimeError) do
19 @commenting1.send(:commentable?, true)
21 assert !@commenting1.send(:commentable?)
22 <% if commentable_models.size > 1 -%>
23 assert @obj3.send(:commentable?)
25 <% if options[:self_referential] -%>
26 assert @comment1.send(:commentable?)