mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Merge pull request #363 from brienw/feature/neo4j_auth_options
Adds support for additional Neo4j::Session.open options
This commit is contained in:
commit
d2a7ee40bf
2 changed files with 12 additions and 1 deletions
|
@ -50,8 +50,12 @@ module DatabaseCleaner
|
|||
database[:path]
|
||||
end
|
||||
|
||||
def db_params
|
||||
database.reject!{|key, value| [:type, :path].include? key }
|
||||
end
|
||||
|
||||
def session
|
||||
@session ||= ::Neo4j::Session.open(db_type, db_path)
|
||||
@session ||= ::Neo4j::Session.open(db_type, db_path, db_params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,13 @@ module DatabaseCleaner
|
|||
subject.db.should eq db_conf
|
||||
end
|
||||
|
||||
it "should respect additional connection parameters" do
|
||||
db_conf = {:type => :server_db, :path => 'http://localhost:7474', basic_auth: {username: 'user', password: 'pass'}}
|
||||
subject.db = db_conf
|
||||
stub_const("Neo4j::Session", double()).should_receive(:open).with(:server_db, 'http://localhost:7474', {basic_auth: {username: 'user', password: 'pass'}}) { true }
|
||||
subject.start
|
||||
end
|
||||
|
||||
it "should default to nil" do
|
||||
subject.db.should be_nil
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue