Sha256: e345a576f219aaae864133bd5404035ee8512cf93fbdd55dd4d6b3554c2f7ba3

Contents?: true

Size: 1.54 KB

Versions: 13

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

module Neo2Spec
  class Person < Pacer::Wrappers::VertexWrapper
    def self.route_conditions(graph)
      { type: 'person' }
    end
  end

  class Frog < Pacer::Wrappers::VertexWrapper
    def self.route_conditions(graph)
      { frog: 'yes' }
    end
  end

  Run.neo4j2 :read_only do
    use_pacer_graphml_data :read_only

    describe '#vertex' do
      it 'should not raise an exception for invalid key type' do
        graph.vertex('bad id').should be_nil
      end
    end

    describe '#edge' do
      it 'should not raise an exception for invalid key type' do
        graph.edge('bad id').should be_nil
      end
    end

    describe 'indexed' do
      before do
        # TODO FIXME: why do the presence of these key indices break lots of
        # subsequent tests if they are on graph rather than graph2?
        graph2.create_key_index :type, :vertex
        graph2.create_key_index :name, :vertex
      end

      describe Person do
        subject { graph2.v(Person) }

        # sanity checks
        it { should be_a Pacer::Filter::LuceneFilter }
        its(:query) { should == 'type:"person"' }
        # This doesn't work because neo indices are out of sync before the transaction finalizes
        #its(:count) { should == 2 }

        its(:wrapper) { should == Person }
      end

      describe Frog do
        subject { graph2.v(Frog) }

        # sanity checks
        it { should_not be_a Pacer::Filter::LuceneFilter }
        its(:count) { should == 0 }

        its(:wrapper) { should == Frog }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pacer-2.0.13-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.12-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.10-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.10.pre-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.8-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.6-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.4.pre-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-2.0.0.pre-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-1.6.0-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-1.5.4-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-1.5.3-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-1.5.2-java spec/pacer/blueprints/neo4j2_spec.rb
pacer-1.5.1-java spec/pacer/blueprints/neo4j2_spec.rb