Sha256: 458a1abba0fc2744d882b1da4a14964b939604e8e55ebda2daa319a5a9a5aff2

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

module Woulda
  module ActsAsParanoid
    module Macros
      def self.should_act_as_solr(*included_associations)
        klass = model_class

        context "A #{klass.name}" do
          should "include the acts_as_solr modules" do
            assert klass.included_modules.include?(ActsAsSolr::ParserMethods)
            assert klass.included_modules.include?(ActsAsSolr::CommonMethods)
            assert klass.included_modules.include?(ActsAsSolr::InstanceMethods)
          end
          
          should "be extended by the acts_as_solr modules" do
            assert klass.extended_by.include?(ActsAsSolr::ClassMethods)
            assert klass.extended_by.include?(ActsAsSolr::ParserMethods)
            assert klass.extended_by.include?(ActsAsSolr::CommonMethods)
            assert klass.extended_by.include?(ActsAsSolr::PaginationExtension)
          end

          included_associations.each do |association|
            should "include the #{association.to_s} association in solr indexing" do
              klass.configuration[:include].include?(association)
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
seanhussey-woulda-0.1.1 lib/woulda/acts_as_solr/macros.rb
seanhussey-woulda-0.1.2 lib/woulda/acts_as_solr/macros.rb
seanhussey-woulda-0.1.3 lib/woulda/acts_as_solr/macros.rb