Sha256: 2adb969cf6cd628adb6d536db649f9b7479530f3c2499e23c36412a5624ad20e

Contents?: true

Size: 1.01 KB

Versions: 85

Compression:

Stored size: 1.01 KB

Contents

module MuckPluginMacros

  def 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 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

ActiveSupport::TestCase.extend(MuckPluginMacros)
Test::Unit::TestCase.extend(MuckPluginMacros)
ActionController::TestCase.extend(MuckPluginMacros)

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
muck-engine-3.5.0 lib/test/shoulda_macros/plugins.rb
muck-engine-3.4.0 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.18 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.17 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.16 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.15 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.14 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.13 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.12 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.11 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.10 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.9 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.8 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.7 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.6 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.5 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.4 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.3 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.2 lib/test/shoulda_macros/plugins.rb
muck-engine-3.3.1 lib/test/shoulda_macros/plugins.rb