mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
taggable_type should be accessible for test
This commit is contained in:
parent
cc21081d77
commit
1234abb266
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue