Sha256: 3a43cb333bdbbcb1a26703214dc0805d873f1d022c20239fbb3318de57f6eded

Contents?: true

Size: 1.3 KB

Versions: 14

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'
require 'database_cleaner/neo4j/base'
require 'database_cleaner/shared_strategy'

module DatabaseCleaner
  describe Neo4j do
    it { should respond_to(:available_strategies) }
  end

  module Neo4j
    class ExampleStrategy
      include ::DatabaseCleaner::Neo4j::Base
    end

    describe ExampleStrategy do

      it_should_behave_like "a generic strategy"
      it { should respond_to(:db) }
      it { should respond_to(:db=) }

      it "should store my describe db" do
        db_conf = {:connection => {:type => :server_db, :path => 'http://localhost:7474'}}
        subject.db = db_conf
        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

      it "should return default configuration" do
        subject.database.should eq(:type => :server_db, :path => 'http://localhost:7475/')
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
database_cleaner-1.6.2 spec/database_cleaner/neo4j/base_spec.rb
database_cleaner-1.6.1 spec/database_cleaner/neo4j/base_spec.rb
database_cleaner-1.6.0 spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/spec/database_cleaner/neo4j/base_spec.rb
database_cleaner-1.5.3 spec/database_cleaner/neo4j/base_spec.rb
database_cleaner-1.5.2 spec/database_cleaner/neo4j/base_spec.rb
database_cleaner-1.5.1 spec/database_cleaner/neo4j/base_spec.rb
database_cleaner-1.5.0 spec/database_cleaner/neo4j/base_spec.rb