spec/unit/connection_spec.rb in couchrest_model-2.2.0.beta1 vs spec/unit/connection_spec.rb in couchrest_model-2.2.0.beta2

- old
+ new

@@ -56,16 +56,10 @@ it "should set the database if object provided" do db = @class.server.database('test') @class.use_database(db) expect(@class.database).to eql(db) end - it "should never prepare the database before it is needed" do - db = @class.server.database('test') - expect(@class).not_to receive(:prepare_database) - @class.use_database('test') - @class.use_database(db) - end it "should use the database specified" do @class.use_database(:test) expect(@class.database.name).to eql('couchrest_test') end end @@ -88,11 +82,11 @@ end it "should provide a server object" do expect(@class.server).to be_a(CouchRest::Server) end it "should provide a server with default config" do - expect(@class.server.uri.to_s).to eql("http://localhost:5984") + expect(@class.server.uri.to_s).to eql(CouchRest::Model::Base.server.uri.to_s) end it "should allow the configuration to be overwritten" do @class.connection = { :protocol => "https", :host => "127.0.0.1", @@ -129,12 +123,13 @@ expect(db.name).to eql('couchrest_test') end it "should use the .use_database value" do @class.use_database('testing') - db = @class.prepare_database + db = @class.database expect(db.name).to eql('couchrest_testing') end + end describe "protected methods" do describe ".connection_configuration" do