Skip to content

Commit

Permalink
Deleting indices after every test
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekprahlad committed Oct 4, 2011
1 parent 7c245e9 commit 418e428
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 22 deletions.
3 changes: 0 additions & 3 deletions spec/rails/active_record_style_relationships_spec.rb
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions spec/rails/finders_spec.rb
Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions spec/rails/model_spec.rb
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions spec/rails/relationship_spec.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 418e428

Please sign in to comment.