Sha256: fe195df35420117a6a00d112e5af2ed6a587088adcaccd14df74baf725d19204

Contents?: true

Size: 915 Bytes

Versions: 7

Compression:

Stored size: 915 Bytes

Contents

require File.expand_path('spec_helper', File.dirname(__FILE__))

describe Sunspot::Rails::Server do
  before :each do
    @server = Sunspot::Rails::Server.new
    @config = Sunspot::Rails::Configuration.new
    allow(@server).to receive(:configuration){ @config }
    @solr_home = File.join(@config.solr_home)
  end

  it "sets the correct Solr home" do
    expect(@server.solr_home).to eq(@solr_home)
  end

  it "sets the correct Solr PID path" do
    expect(@server.pid_path).to eq(File.join(@server.pid_dir, 'sunspot-solr-test.pid'))
  end

  it "sets the correct port" do
    expect(@server.port).to eq(8983)
  end

  it "sets the log level using configuration" do
    allow(@config).to receive(:log_level){ 'WARNING' }
    expect(@server.log_level).to eq("WARNING")
  end

  it "sets the correct log file" do
    expect(@server.log_file).to eq(File.join(Rails.root, 'log', 'sunspot-solr-test.log'))
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sunspot_rails-2.7.1 spec/server_spec.rb
sunspot_rails-2.7.0 spec/server_spec.rb
sunspot_rails-2.6.0 spec/server_spec.rb
sunspot_rails-2.5.0 spec/server_spec.rb
sunspot_rails-2.4.0 spec/server_spec.rb
sunspot_rails-2.3.0 spec/server_spec.rb
sunspot_rails-2.2.8 spec/server_spec.rb