Commit d0444d5ae449404a844e21de9fc85a459bf1311f

Authored by AntonioTerceiro
1 parent 73823927

ActionItem558: rebuilding ferret index before tests



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2312 3f533792-8f58-4932-b0fe-aaf55b0a4547
test/functional/search_controller_test.rb
... ... @@ -11,6 +11,8 @@ class SearchControllerTest < Test::Unit::TestCase
11 11 @response = ActionController::TestResponse.new
12 12  
13 13 @category = Category.create!(:name => 'my category', :environment => Environment.default)
  14 + Profile.rebuild_index
  15 + Article.rebuild_index
14 16 end
15 17  
16 18 def test_local_files_reference
... ...
test/unit/category_finder_test.rb
... ... @@ -5,6 +5,8 @@ class CategoryFinderTest < ActiveSupport::TestCase
5 5 def setup
6 6 @category = Category.create!(:name => 'my category', :environment => Environment.default)
7 7 @finder = CategoryFinder.new(@category)
  8 +
  9 + Profile.rebuild_index
8 10 end
9 11  
10 12 should 'search for articles in a specific category' do
... ...
test/unit/environment_finder_test.rb
... ... @@ -2,8 +2,12 @@ require File.dirname(__FILE__) + '/../test_helper'
2 2  
3 3 class EnvironmentFinderTest < ActiveSupport::TestCase
4 4  
5   - all_fixtures
  5 +# all_fixtures
6 6  
  7 + def setup
  8 + Profile.rebuild_index
  9 + end
  10 +
7 11 should 'find articles' do
8 12 person = create_user('teste').person
9 13 art = person.articles.build(:name => 'an article to be found'); art.save!
... ...
test/unit/tiny_mce_article_test.rb
... ... @@ -2,6 +2,10 @@ require File.dirname(__FILE__) + &#39;/../test_helper&#39;
2 2  
3 3 class TinyMceArticleTest < Test::Unit::TestCase
4 4  
  5 + def setup
  6 + Article.rebuild_index
  7 + end
  8 +
5 9 # this test can be removed when we get real tests for TinyMceArticle
6 10 should 'be an article' do
7 11 assert_subclass TextArticle, TinyMceArticle
... ...