Sha256: 9ed2c5cc1cd615f478d0f320f36f07f7bcbbdd4b9323eebcc5541f1db89bdfd0

Contents?: true

Size: 1.55 KB

Versions: 12

Compression:

Stored size: 1.55 KB

Contents

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

describe Sunspot::Rails::Configuration, "default values" do
  before(:each) do
    File.should_receive(:exist?).and_return(false)
  end
  
  it "should handle the 'hostname' property when not set" do
    config = Sunspot::Rails::Configuration.new
    config.hostname.should == 'localhost'
  end  
  
  it "should handle the 'path' property when not set" do
    config = Sunspot::Rails::Configuration.new
    config.path.should == '/solr'
  end

  it "should handle the 'port' property when not set" do
    config = Sunspot::Rails::Configuration.new
    config.port.should == 8983
  end

  it "should handle the 'auto_commit_after_request' propery when not set" do
    config = Sunspot::Rails::Configuration.new
    config.auto_commit_after_request?.should == true
  end
end

describe Sunspot::Rails::Configuration, "user settings" do
  before(:each) do
    Rails.stub!(:env => 'config_test')
  end

  it "should handle the 'hostname' property when not set" do
    config = Sunspot::Rails::Configuration.new
    config.hostname.should == 'some.host'
  end

  it "should handle the 'port' property when not set" do
    config = Sunspot::Rails::Configuration.new
    config.port.should == 1234
  end
  
  it "should handle the 'path' property when set" do
    config = Sunspot::Rails::Configuration.new
    config.path.should == '/solr/idx'
  end

  it "should handle the 'auto_commit_after_request' propery when set" do
    config = Sunspot::Rails::Configuration.new
    config.auto_commit_after_request?.should == false
  end
end

Version data entries

12 entries across 12 versions & 6 rubygems

Version Path
collectiveidea-sunspot_rails-0.10.5 spec/configuration_spec.rb
collectiveidea-sunspot_rails-0.10.6 spec/configuration_spec.rb
kristopher-sunspot_rails-0.10.6 spec/configuration_spec.rb
outoftime-sunspot_rails-0.10.5 spec/configuration_spec.rb
ssoroka-sunspot_rails-0.10.5 spec/configuration_spec.rb
ssoroka-sunspot_rails-0.10.6 spec/configuration_spec.rb
goldstar-sunspot_rails-0.10.6.3 spec/configuration_spec.rb
goldstar-sunspot_rails-0.10.6.1 spec/configuration_spec.rb
sunspot_rails-0.10.9 spec/configuration_spec.rb
sunspot_rails-0.10.8 spec/configuration_spec.rb
sunspot_rails-0.10.7 spec/configuration_spec.rb
sunspot_rails-0.10.5 spec/configuration_spec.rb