Sha256: a2d084e9db4398860dc283b83dbabe0c09215caac4ebf6fa09f084bd94b1c100

Contents?: true

Size: 1.03 KB

Versions: 154

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

154 entries across 154 versions & 6 rubygems

Version Path
muck-raker-0.1.49 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.48 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.47 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.46 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.45 test/rails_root/test/shoulda_macros/plugins.rb
muck-engine-0.2.4 test/rails_root/test/shoulda_macros/plugins.rb
muck-engine-0.2.3 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.43 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.42 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.41 test/rails_root/test/shoulda_macros/plugins.rb
muck-users-0.2.14 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.40 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.39 test/rails_root/test/shoulda_macros/plugins.rb
muck-friends-0.1.12 test/rails_root/test/shoulda_macros/plugins.rb
muck-users-0.2.13 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.38 test/rails_root/test/shoulda_macros/plugins.rb
muck-engine-0.2.2 test/rails_root/test/shoulda_macros/plugins.rb
muck-users-0.2.12 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.37 test/rails_root/test/shoulda_macros/plugins.rb
muck-raker-0.1.36 test/rails_root/test/shoulda_macros/plugins.rb