Sha256: 4d189b3d8f12d9a6a48571655ef9e3837f1001973cc75a45f1da94152f79acf6

Contents?: true

Size: 1009 Bytes

Versions: 8

Compression:

Stored size: 1009 Bytes

Contents

require 'spec_helper'

describe Supernova::Solr do
  before(:each) do
    Supernova::Solr.url = "http://some.host:12345/path/to/solr"
  end
  
  describe "#url=" do
    it "allows setting a solr url" do
      Supernova::Solr.url = "some url"
      Supernova::Solr.url.should == "some url"
    end
  end
  
  describe "truncate!" do
    it "sends the correct update request" do
      Typhoeus::Request.should_receive(:post).with("http://some.host:12345/path/to/solr/update", 
        :body => %(<?xml version="1.0" encoding="UTF-8"?><delete><query>*:*</query></delete>), :headers => { "Content-Type" => "text/xml"}
      )
      Supernova::Solr.truncate!
    end
  end
  
  describe "#commit!" do
    it "sends the correct update request" do
      Typhoeus::Request.should_receive(:post).with("http://some.host:12345/path/to/solr/update", 
        :body => %(<?xml version="1.0" encoding="UTF-8"?><commit />), :headers => { "Content-Type" => "text/xml"}
      )
      Supernova::Solr.commit!
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
supernova-0.7.6 spec/supernova/solr_spec.rb
supernova-0.7.5 spec/supernova/solr_spec.rb
supernova-0.7.4 spec/supernova/solr_spec.rb
supernova-0.7.3 spec/supernova/solr_spec.rb
supernova-0.7.2 spec/supernova/solr_spec.rb
supernova-0.7.1 spec/supernova/solr_spec.rb
supernova-0.7.0 spec/supernova/solr_spec.rb
supernova-0.6.8 spec/supernova/solr_spec.rb