spec/api/client_spec.rb in rsolr-2.0.0.pre1 vs spec/api/client_spec.rb in rsolr-2.0.0.pre2

- old
+ new

@@ -65,22 +65,10 @@ ) client.post "update", request_opts end end - context "xml" do - it "should return an instance of RSolr::Xml::Generator" do - expect(client.xml).to be_a RSolr::Xml::Generator - end - end - - context "json" do - it "should return an instance of RSolr::JSON::Generator" do - expect(client.json).to be_a RSolr::JSON::Generator - end - end - context "add" do it "should send xml to the connection's #post method" do expect(client).to receive(:execute). with( hash_including({ @@ -93,11 +81,11 @@ and_return( :body => "", :status => 200, :headers => {"Content-Type"=>"text/xml"} ) - expect(client.xml).to receive(:add). + expect(client.builder).to receive(:add). with({:id=>1}, {:commitWith=>10}). and_return("<xml/>") client.add({:id=>1}, :add_attributes => {:commitWith=>10}) end @@ -117,10 +105,10 @@ and_return( :body => "", :status => 200, :headers => {"Content-Type"=>"text/xml"} ) - expect(client.json).to receive(:add). + expect(client.builder).to receive(:add). with({:id => 1}, {:commitWith=>10}). and_return('{"hello":"this is json"}') client.add({:id=>1}, :add_attributes => {:commitWith=>10}) end