Sha256: 6e92ca7400b5bbbe4d100faee28434079503ec7950768e11d11557e427e13883
Contents?: true
Size: 1.16 KB
Versions: 9
Compression:
Stored size: 1.16 KB
Contents
# encoding: utf-8 require File.dirname(__FILE__) + '/../../spec_helper' require File.dirname(__FILE__) + '/data_store_spec' require 'mongo' describe Dragonfly::DataStorage::MongoDataStore do before(:each) do begin Mongo::Connection.new rescue Mongo::ConnectionFailure => e pending "You need to start mongo on localhost:27017 to test the MongoDataStore" end @data_store = Dragonfly::DataStorage::MongoDataStore.new :database => 'dragonfly_test' end it_should_behave_like 'data_store' describe "authenticating" do before(:each) do @temp_object = Dragonfly::TempObject.new('Feijão verde') end it "should not attempt to authenticate if a username is not given" do @data_store.db.should_not_receive(:authenticate) @data_store.store(@temp_object) end it "should attempt to authenticate once if a username is given" do @data_store.username = 'terry' @data_store.password = 'butcher' @data_store.db.should_receive(:authenticate).exactly(:once).with('terry','butcher').and_return(true) uid = @data_store.store(@temp_object) @data_store.retrieve(uid) end end end
Version data entries
9 entries across 9 versions & 2 rubygems