From faa656d53dc452b4543b8b7a4875ddb55a49be82 Mon Sep 17 00:00:00 2001 From: Vivek Prahlad Date: Tue, 4 Oct 2011 23:08:02 +0530 Subject: [PATCH 1/3] Triggering build --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3d8c735ea..18914af69 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -51,7 +51,7 @@ def new_tx RSpec.configure do |c| $name_counter = 0 - #c.filter = { :type => :problem} + c.before(:each, :type => :transactional) do new_tx end From 7c245e9814baaeb96caa322018e44fadbcbdb505 Mon Sep 17 00:00:00 2001 From: Vivek Prahlad Date: Tue, 4 Oct 2011 23:47:50 +0530 Subject: [PATCH 2/3] Fixing failing tests --- spec/rails/finders_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/rails/finders_spec.rb b/spec/rails/finders_spec.rb index 19e45aa07..3f7f4cfa1 100644 --- a/spec/rails/finders_spec.rb +++ b/spec/rails/finders_spec.rb @@ -16,6 +16,9 @@ def to_s subject { FindableModel.create!(:name => "Test 1", :age => 4241) } before(:each) do + Neo4j::Transaction.run do + Neo4j::Index::IndexerRegistry.delete_all_indexes + end @test_0 = FindableModel.create!(:name => "Test 0") @test_2 = FindableModel.create!(:name => "Test 2") @test_3 = FindableModel.create!(:name => "Test 3", :age => 3) From 418e428718313f0ab40175e7a4ff8b490e1c74c3 Mon Sep 17 00:00:00 2001 From: Vivek Prahlad Date: Wed, 5 Oct 2011 00:01:00 +0530 Subject: [PATCH 3/3] Deleting indices after every test --- spec/rails/active_record_style_relationships_spec.rb | 3 --- spec/rails/finders_spec.rb | 3 --- spec/rails/model_spec.rb | 6 ------ spec/rails/relationship_spec.rb | 7 ------- spec/spec_helper.rb | 6 +++--- 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/spec/rails/active_record_style_relationships_spec.rb b/spec/rails/active_record_style_relationships_spec.rb index 851666aef..bd697129c 100644 --- a/spec/rails/active_record_style_relationships_spec.rb +++ b/spec/rails/active_record_style_relationships_spec.rb @@ -7,9 +7,6 @@ class ModelRelationship1 < Neo4j::Rails::Relationship end before(:each) do - Neo4j::Transaction.run do - Neo4j::Index::IndexerRegistry.delete_all_indexes - end @actor_class = create_model(Neo4j::Model) @actor_class.property :name @actor_class.property :description diff --git a/spec/rails/finders_spec.rb b/spec/rails/finders_spec.rb index 3f7f4cfa1..19e45aa07 100644 --- a/spec/rails/finders_spec.rb +++ b/spec/rails/finders_spec.rb @@ -16,9 +16,6 @@ def to_s subject { FindableModel.create!(:name => "Test 1", :age => 4241) } before(:each) do - Neo4j::Transaction.run do - Neo4j::Index::IndexerRegistry.delete_all_indexes - end @test_0 = FindableModel.create!(:name => "Test 0") @test_2 = FindableModel.create!(:name => "Test 2") @test_3 = FindableModel.create!(:name => "Test 3", :age => 3) diff --git a/spec/rails/model_spec.rb b/spec/rails/model_spec.rb index 555adc153..d7de7d04e 100644 --- a/spec/rails/model_spec.rb +++ b/spec/rails/model_spec.rb @@ -3,12 +3,6 @@ # Specs written by Nick Sieger and modified by Andreas Ronge describe Neo4j::Model do - before(:each) do - Neo4j::Transaction.run do - Neo4j::Index::IndexerRegistry.delete_all_indexes - end - end - describe "new" do before :each do @model = Neo4j::Model.new diff --git a/spec/rails/relationship_spec.rb b/spec/rails/relationship_spec.rb index 5bdc11981..f6a3ca96b 100644 --- a/spec/rails/relationship_spec.rb +++ b/spec/rails/relationship_spec.rb @@ -620,10 +620,6 @@ def reject_posts(attributed) context "when there's lots of them" do before(:each) do - Neo4j::Transaction.run do - Neo4j::Index::IndexerRegistry.delete_all_indexes - end - subject.class.create!(:foo, @start_node, @end_node) subject.class.create!(:foo, @start_node, @end_node) subject.class.create!(:foo, @start_node, @end_node) @@ -671,9 +667,6 @@ def mark_saved describe RelationshipWithProperty do before(:each) do - Neo4j::Transaction.run do - Neo4j::Index::IndexerRegistry.delete_all_indexes - end @start_node = Neo4j::Model.new @end_node = Neo4j::Model.new end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 18914af69..43ccad25a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -59,14 +59,14 @@ def new_tx c.after(:each, :type => :transactional) do finish_tx Neo4j::Rails::Model.close_lucene_connections - Neo4j::Transaction.run do - Neo4j::Index::IndexerRegistry.delete_all_indexes - end end c.after(:each) do finish_tx Neo4j::Rails::Model.close_lucene_connections + Neo4j::Transaction.run do + Neo4j::Index::IndexerRegistry.delete_all_indexes + end Neo4j::Transaction.run do Neo4j.threadlocal_ref_node = Neo4j::Node.new :name => "ref_#{$name_counter}" $name_counter += 1