Commit fb2196ada14aa88ec4339a55a116a28affc98069

Authored by MoisesMachado
1 parent fa430142

ActionItem392: fixing two test to work with a remote ferret server


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2055 3f533792-8f58-4932-b0fe-aaf55b0a4547
config/ferret_server.yml
... ... @@ -6,7 +6,7 @@ development:
6 6 host: localhost
7 7 port: 9010
8 8 pid_file: log/ferret.pid
9   -test:
10   - host: localhost
11   - port: 9009
12   - pid_file: log/ferret.pid
  9 +#test:
  10 +# host: localhost
  11 +# port: 9009
  12 +# pid_file: log/ferret.pid
... ...
test/functional/search_controller_test.rb
... ... @@ -487,8 +487,6 @@ class SearchControllerTest < Test::Unit::TestCase
487 487 p.categories << child
488 488 p.save!
489 489  
490   - Profile.rebuild_index
491   -
492 490 get :index, :category_path => ['parent-category'], :query => 'test_profile', :find_in => ['people']
493 491  
494 492 assert_includes assigns(:results)[:people], p
... ...
test/mocks/test/testing_extra_data_for_index.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +class TestingExtraDataForIndex < Profile
  2 + extra_data_for_index do |obj|
  3 + 'sample indexed text'
  4 + end
  5 +end
... ...
test/unit/profile_test.rb
... ... @@ -516,14 +516,10 @@ class ProfileTest &lt; Test::Unit::TestCase
516 516 assert_includes klass.new.extra_data_for_index, result
517 517 end
518 518  
  519 + # TestingExtraDataForIndex is a subclass of profile that adds a block as
  520 + # content to be added to the index. The block returns "sample indexed text"
  521 + # see test/mocks/test/testing_extra_data_for_index.rb
519 522 should 'actually index by results of extra_data_for_index' do
520   -
521   - class ::TestingExtraDataForIndex < Profile
522   - extra_data_for_index do |obj|
523   - 'sample indexed text'
524   - end
525   - end
526   -
527 523 profile = TestingExtraDataForIndex.create!(:name => 'testprofile', :identifier => 'testprofile')
528 524  
529 525 assert_includes TestingExtraDataForIndex.find_by_contents('sample'), profile
... ...