Commit d0444d5ae449404a844e21de9fc85a459bf1311f
1 parent
73823927
Exists in
master
and in
22 other branches
ActionItem558: rebuilding ferret index before tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2312 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
13 additions
and
1 deletions
Show diff stats
test/functional/search_controller_test.rb
| @@ -11,6 +11,8 @@ class SearchControllerTest < Test::Unit::TestCase | @@ -11,6 +11,8 @@ class SearchControllerTest < Test::Unit::TestCase | ||
| 11 | @response = ActionController::TestResponse.new | 11 | @response = ActionController::TestResponse.new |
| 12 | 12 | ||
| 13 | @category = Category.create!(:name => 'my category', :environment => Environment.default) | 13 | @category = Category.create!(:name => 'my category', :environment => Environment.default) |
| 14 | + Profile.rebuild_index | ||
| 15 | + Article.rebuild_index | ||
| 14 | end | 16 | end |
| 15 | 17 | ||
| 16 | def test_local_files_reference | 18 | def test_local_files_reference |
test/unit/category_finder_test.rb
| @@ -5,6 +5,8 @@ class CategoryFinderTest < ActiveSupport::TestCase | @@ -5,6 +5,8 @@ class CategoryFinderTest < ActiveSupport::TestCase | ||
| 5 | def setup | 5 | def setup |
| 6 | @category = Category.create!(:name => 'my category', :environment => Environment.default) | 6 | @category = Category.create!(:name => 'my category', :environment => Environment.default) |
| 7 | @finder = CategoryFinder.new(@category) | 7 | @finder = CategoryFinder.new(@category) |
| 8 | + | ||
| 9 | + Profile.rebuild_index | ||
| 8 | end | 10 | end |
| 9 | 11 | ||
| 10 | should 'search for articles in a specific category' do | 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,8 +2,12 @@ require File.dirname(__FILE__) + '/../test_helper' | ||
| 2 | 2 | ||
| 3 | class EnvironmentFinderTest < ActiveSupport::TestCase | 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 | should 'find articles' do | 11 | should 'find articles' do |
| 8 | person = create_user('teste').person | 12 | person = create_user('teste').person |
| 9 | art = person.articles.build(:name => 'an article to be found'); art.save! | 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__) + '/../test_helper' | @@ -2,6 +2,10 @@ require File.dirname(__FILE__) + '/../test_helper' | ||
| 2 | 2 | ||
| 3 | class TinyMceArticleTest < Test::Unit::TestCase | 3 | class TinyMceArticleTest < Test::Unit::TestCase |
| 4 | 4 | ||
| 5 | + def setup | ||
| 6 | + Article.rebuild_index | ||
| 7 | + end | ||
| 8 | + | ||
| 5 | # this test can be removed when we get real tests for TinyMceArticle | 9 | # this test can be removed when we get real tests for TinyMceArticle |
| 6 | should 'be an article' do | 10 | should 'be an article' do |
| 7 | assert_subclass TextArticle, TinyMceArticle | 11 | assert_subclass TextArticle, TinyMceArticle |