Sha256: 6e57b41af2aa50d58951e9a8dbb1bca3c41a4e74cb287506998e3efbb44b1b91

Contents?: true

Size: 809 Bytes

Versions: 3

Compression:

Stored size: 809 Bytes

Contents

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

describe Sunspot do

  describe "setup" do
    it "should register the class in Sunspot.searchable" do
      Sunspot.setup(User) do
        text :name
      end
      expect(Sunspot.searchable).not_to be_empty
      expect(Sunspot.searchable).to include(User)
    end
  end

  describe "reset!" do
    it "should reset current session" do
      old_session = Sunspot.send(:session)
      Sunspot.reset!(true)
      expect(Sunspot.send(:session)).not_to eq(old_session)
    end

    it "should keep keep configuration if specified" do
      Sunspot.config.solr.url = "http://localhost:9999/path/solr"
      config_before_reset = Sunspot.config
      Sunspot.reset!(true)
      expect(Sunspot.config).to eq(config_before_reset)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sunspot-2.4.0 spec/api/sunspot_spec.rb
sunspot-2.3.0 spec/api/sunspot_spec.rb
sunspot-2.2.8 spec/api/sunspot_spec.rb