shoulda_macros/units.rb
##
#  Asserts that model has act_as_taggable_on defined for certain categories.
#
#    should_act_as_taggable_on :category_name
#    (default :category_name is :tags)
#
Asserts that model has act_as_taggable_on defined for certain categories.
Asserts that model has act_as_taggable_on defined for certain categories .
def should_act_as_taggable_on(category = :tags)
      klass = self.name.gsub(/Test$/, '').constantize
      should "include ActAsTaggableOn #{':' + category.to_s} methods" do
        assert klass.extended_by.include?(ActiveRecord::Acts::TaggableOn::ClassMethods)
        assert klass.extended_by.include?(ActiveRecord::Acts::TaggableOn::SingletonMethods)
        assert klass.include?(ActiveRecord::Acts::TaggableOn::InstanceMethods)
      end
      should_have_many :taggings, category
    end
def should_act_as_taggable_on ( category = :tags ) klass = self . name . gsub ( / Test$ / , '' ) . constantize should "include ActAsTaggableOn #{':' + category.to_s} methods" do assert klass . extended_by . include? ( ActiveRecord :: Acts :: TaggableOn :: ClassMethods ) assert klass . extended_by . include? ( ActiveRecord :: Acts :: TaggableOn :: SingletonMethods ) assert klass . include? ( ActiveRecord :: Acts :: TaggableOn :: InstanceMethods ) end should_have_many :taggings , category end
Asserts that model has act_as_taggable_on defined for certain categories.
Asserts that model has act_as_taggable_on defined for certain categories .
category