Sha256: 3cdcf302fd7bffa081ea8acc57c15aa0ddea84e684c2275ea10f179f265ea261

Contents?: true

Size: 903 Bytes

Versions: 6

Compression:

Stored size: 903 Bytes

Contents

class ActiveSupport::TestCase

  def self.should_act_as_taggable_on_steroids
    klass = self.name.gsub(/Test$/, '').constantize

    should "include ActsAsTaggableOnSteroids methods" do
      assert klass.extended_by.include?(ActiveRecord::Acts::Taggable::ClassMethods)
      assert klass.extended_by.include?(ActiveRecord::Acts::Taggable::SingletonMethods)
      assert klass.include?(ActiveRecord::Acts::Taggable::InstanceMethods)
    end

    should_have_many :taggings, :tags
  end


  def self.should_act_as_list
    klass = self.name.gsub(/Test$/, '').constantize

    context "To support acts_as_list" do
      should_have_db_column('position', :type => :integer)
    end

    should "include ActsAsList methods" do
      assert klass.include?(ActiveRecord::Acts::List::InstanceMethods)
    end

    should_have_instance_methods :acts_as_list_class, :position_column, :scope_condition
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
muck-users-0.1.4 test/rails_root/test/shoulda_macros/plugins.rb
muck-users-0.1.5 test/rails_root/test/shoulda_macros/plugins.rb
muck-users-0.1.0 test/shoulda_macros/plugins.rb
muck-users-0.1.1 test/shoulda_macros/plugins.rb
muck-users-0.1.2 test/shoulda_macros/plugins.rb
muck-users-0.1.3 test/shoulda_macros/plugins.rb