Permalink
Browse files

@bugFix Clean Message server of "elasticsearch" when run tests

  • Loading branch information...
1 parent c8c231c commit b9b9d1bc959d618b736aafdf577881b010a8fae3 @jeroig jeroig committed with angelf Dec 21, 2010
Showing with 7 additions and 13 deletions.
  1. +7 −13 test/nrt_enqueue_test.rb
View
@@ -1,8 +1,6 @@
# tests the Near Real Time support in the :updates => true mode
-
require 'test_helper'
-
require File.dirname(__FILE__) + '/test_helper.rb'
class NrtEnqueue < Test::Unit::TestCase
@@ -26,13 +24,10 @@ def setup
def test_document_creation
# the Resque tasks have not run yet, so there should be nothing in the index
- User.refresh_index
- assert_equal 0, User.search_count
-
- # now run the Resque tasks and check that the index is good
+ # but now run the Resque tasks and check that the index is good
Resque.run!
User.refresh_index
-
+
assert_equal 5, User.search("*").total_entries
results = User.search("wise")
assert_equal results.total_entries, 1
@@ -43,8 +38,9 @@ def test_document_updates
# now run the Resque tasks and check that the index is good
Resque.run!
User.refresh_index
+
assert_equal 5, User.search("*").total_entries
-
+
# make a change in a document
@tim.name = 'Tim the Reborn'
@tim.save!
@@ -67,20 +63,18 @@ def test_document_deletes
Resque.run!
User.refresh_index
- #puts "TOTAL: " + User.search("*").inspect
- #puts "TOTAL: " + User.search("*").total_entries.to_s
assert_equal User.search("*").total_entries, 5
+ # Destroy the element
@tim.destroy
User.refresh_index
-
- #puts "TOTAL POST DESTROY: " + User.search("*").total_entries.to_s
+
+ # but still there until run Resque
assert_equal User.search("*").total_entries, 5
# but when we run the Resque tasks, all is well
Resque.run!
User.refresh_index
-
assert_equal User.search("*").total_entries, 4
end

0 comments on commit b9b9d1b

Please sign in to comment.