From fb2196ada14aa88ec4339a55a116a28affc98069 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Thu, 19 Jun 2008 23:13:14 +0000 Subject: [PATCH] ActionItem392: fixing two test to work with a remote ferret server --- config/ferret_server.yml | 8 ++++---- test/functional/search_controller_test.rb | 2 -- test/mocks/test/testing_extra_data_for_index.rb | 5 +++++ test/unit/profile_test.rb | 10 +++------- 4 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 test/mocks/test/testing_extra_data_for_index.rb diff --git a/config/ferret_server.yml b/config/ferret_server.yml index ea2dc98..ac4e5c5 100644 --- a/config/ferret_server.yml +++ b/config/ferret_server.yml @@ -6,7 +6,7 @@ development: host: localhost port: 9010 pid_file: log/ferret.pid -test: - host: localhost - port: 9009 - pid_file: log/ferret.pid +#test: +# host: localhost +# port: 9009 +# pid_file: log/ferret.pid diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 8d624e7..522cdec 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -487,8 +487,6 @@ class SearchControllerTest < Test::Unit::TestCase p.categories << child p.save! - Profile.rebuild_index - get :index, :category_path => ['parent-category'], :query => 'test_profile', :find_in => ['people'] assert_includes assigns(:results)[:people], p diff --git a/test/mocks/test/testing_extra_data_for_index.rb b/test/mocks/test/testing_extra_data_for_index.rb new file mode 100644 index 0000000..11f4bb5 --- /dev/null +++ b/test/mocks/test/testing_extra_data_for_index.rb @@ -0,0 +1,5 @@ +class TestingExtraDataForIndex < Profile + extra_data_for_index do |obj| + 'sample indexed text' + end +end diff --git a/test/unit/profile_test.rb b/test/unit/profile_test.rb index 440e367..cf631f9 100644 --- a/test/unit/profile_test.rb +++ b/test/unit/profile_test.rb @@ -516,14 +516,10 @@ class ProfileTest < Test::Unit::TestCase assert_includes klass.new.extra_data_for_index, result end + # TestingExtraDataForIndex is a subclass of profile that adds a block as + # content to be added to the index. The block returns "sample indexed text" + # see test/mocks/test/testing_extra_data_for_index.rb should 'actually index by results of extra_data_for_index' do - - class ::TestingExtraDataForIndex < Profile - extra_data_for_index do |obj| - 'sample indexed text' - end - end - profile = TestingExtraDataForIndex.create!(:name => 'testprofile', :identifier => 'testprofile') assert_includes TestingExtraDataForIndex.find_by_contents('sample'), profile -- libgit2 0.21.2