taggable_type should be accessible for test

This commit is contained in:
Reinier Balt 2013-05-13 12:32:41 +02:00
parent cc21081d77
commit 1234abb266
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@
class Tagging < ActiveRecord::Base
attr_accessible :taggable_id, :tag
attr_accessible :taggable_id, :tag, :taggable_type
belongs_to :tag
belongs_to :taggable, :polymorphic => true, :touch => true

View file

@ -5,9 +5,9 @@ class TaggingTest < ActiveSupport::TestCase
def test_removes_unused_tags
tag = Tag.create!(:name => "hello")
tagging = Tagging.create!(:tag => tag, :taggable_id => 1)
tagging = Tagging.create!(:tag => tag, :taggable_id => 1, :taggable_type => "Todo")
assert_equal 1, Tagging.find(:all, :conditions => ["tag_id = ?", tag.id]).count
assert_equal 1, Tagging.where("tag_id = ?", tag.id).count
tagging.destroy