Sha256: 7d5a08a0e89c2be418306816c9166b92f8cceb6ec17c5d549bcf8853c5d0c750

Contents?: true

Size: 1.03 KB

Versions: 37

Compression:

Stored size: 1.03 KB

Contents

module ShouldaPluginMacros

  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

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

Version data entries

37 entries across 37 versions & 5 rubygems

Version Path
muck-comments-0.1.14 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.11 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.10 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.9 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.8 test/rails_root/test/shoulda_macros/plugins.rb
muck-invites-0.1.2 test/rails_root/test/shoulda_macros/plugins.rb
muck-shares-0.1.7 test/rails_root/test/shoulda_macros/plugins.rb
muck-blogs-0.1.7 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.7 test/rails_root/test/shoulda_macros/plugins.rb
muck-comments-0.1.13 test/rails_root/test/shoulda_macros/plugins.rb
muck-invites-0.1.1 test/rails_root/test/shoulda_macros/plugins.rb
muck-shares-0.1.6 test/rails_root/test/shoulda_macros/plugins.rb
muck-blogs-0.1.6 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.6 test/rails_root/test/shoulda_macros/plugins.rb
muck-comments-0.1.12 test/rails_root/test/shoulda_macros/plugins.rb
muck-shares-0.1.5 test/rails_root/test/shoulda_macros/plugins.rb
muck-contents-0.1.5 test/rails_root/test/shoulda_macros/plugins.rb
muck-comments-0.1.11 test/rails_root/test/shoulda_macros/plugins.rb
muck-blogs-0.1.5 test/rails_root/test/shoulda_macros/plugins.rb
muck-shares-0.1.4 test/rails_root/test/shoulda_macros/plugins.rb