Sha256: a6fd98efd78c8ce0787a924ee8f8b18f9f9df8a0bed5d6bda667015462a25878

Contents?: true

Size: 569 Bytes

Versions: 6

Compression:

Stored size: 569 Bytes

Contents

module IntegrationHelper
  def self.included(base)
    base.before(:all) do
      Sunspot.config.solr.url = ENV['SOLR_URL'] || 'http://localhost:8983/solr/default'
      Sunspot.config.solr.update_format = ENV['UPDATE_FORMAT'].to_sym if ENV['UPDATE_FORMAT']
      Sunspot.reset!(true)
    end
  end

  def featured_for_posts(method, param, negated = false)
    with_method = negated ? :without : :with
    param = date_ranges[param] if param.is_a? String

    Sunspot.search(Post) do
      send(with_method, :featured_for).send(method, param)
    end.results
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sunspot-2.7.1 spec/helpers/integration_helper.rb
sunspot-2.7.0 spec/helpers/integration_helper.rb
sunspot-2.6.0 spec/helpers/integration_helper.rb
sunspot-2.5.0 spec/helpers/integration_helper.rb
sunspot-2.4.0 spec/helpers/integration_helper.rb
sunspot-2.3.0 spec/helpers/integration_helper.rb