Sha256: 29c09db91bad072546a3290576b8ba3076d5eb1c9e7e3915687e731f12b958e1

Contents?: true

Size: 475 Bytes

Versions: 9

Compression:

Stored size: 475 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.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

9 entries across 9 versions & 2 rubygems

Version Path
sunspot-2.2.8 spec/helpers/integration_helper.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/spec/helpers/integration_helper.rb
sunspot-2.2.7 spec/helpers/integration_helper.rb
sunspot-2.2.6 spec/helpers/integration_helper.rb
sunspot-2.2.5 spec/helpers/integration_helper.rb
sunspot-2.2.4 spec/helpers/integration_helper.rb
sunspot-2.2.3 spec/helpers/integration_helper.rb
sunspot-2.2.2 spec/helpers/integration_helper.rb
sunspot-2.2.1 spec/helpers/integration_helper.rb