Commit d17e27672f833433ac90c24ac295ee16d64c37ee
1 parent
6c88dddf
Exists in
master
and in
29 other branches
Fixing tests in SearchController
Showing
1 changed file
with
7 additions
and
7 deletions
Show diff stats
test/functional/search_controller_test.rb
... | ... | @@ -423,7 +423,7 @@ class SearchControllerTest < ActionController::TestCase |
423 | 423 | get :index, :category_path => [ 'randomcat', 'randomchild' ], :query => 'some random query', :search_whole_site => 'yes' |
424 | 424 | |
425 | 425 | # search_whole_site must be removed to precent a infinite redirect loop |
426 | - assert_redirected_to :action => 'index', :category_path => [], :query => 'some random query', :search_whole_site => nil | |
426 | + assert_redirected_to :controller.to_s => 'search', :action.to_s => 'index', :category_path.to_s => [], :query.to_s => 'some random query', :search_whole_site.to_s => nil, :search_whole_site_yes.to_s => nil | |
427 | 427 | end |
428 | 428 | |
429 | 429 | should 'submit form to root when not inside a filter' do |
... | ... | @@ -456,7 +456,7 @@ class SearchControllerTest < ActionController::TestCase |
456 | 456 | finder = CategoryFinder.new(@category) |
457 | 457 | finder.expects(:recent).with(any_parameters).at_least_once |
458 | 458 | finder.expects(:recent).with('text_articles', anything).returns(recent) |
459 | - CategoryFinder.expects(:new).with(@category).returns(finder) | |
459 | + CategoryFinder.stubs(:new).with(@category).returns(finder) | |
460 | 460 | |
461 | 461 | get :category_index, :category_path => [ 'my-category' ] |
462 | 462 | assert_same recent, assigns(:results)[:articles] |
... | ... | @@ -466,7 +466,7 @@ class SearchControllerTest < ActionController::TestCase |
466 | 466 | most_commented = [] |
467 | 467 | finder = CategoryFinder.new(@category) |
468 | 468 | finder.expects(:most_commented_articles).returns(most_commented) |
469 | - CategoryFinder.expects(:new).with(@category).returns(finder) | |
469 | + CategoryFinder.stubs(:new).with(@category).returns(finder) | |
470 | 470 | |
471 | 471 | get :category_index, :category_path => [ 'my-category' ] |
472 | 472 | assert_same most_commented, assigns(:results)[:most_commented_articles] |
... | ... | @@ -477,7 +477,7 @@ class SearchControllerTest < ActionController::TestCase |
477 | 477 | finder = CategoryFinder.new(@category) |
478 | 478 | finder.expects(:recent).with(any_parameters).at_least_once |
479 | 479 | finder.expects(:recent).with('people', kind_of(Integer)).returns(recent_people) |
480 | - CategoryFinder.expects(:new).with(@category).returns(finder) | |
480 | + CategoryFinder.stubs(:new).with(@category).returns(finder) | |
481 | 481 | |
482 | 482 | get :category_index, :category_path => [ 'my-category' ] |
483 | 483 | assert_same recent_people, assigns(:results)[:people] |
... | ... | @@ -488,7 +488,7 @@ class SearchControllerTest < ActionController::TestCase |
488 | 488 | finder = CategoryFinder.new(@category) |
489 | 489 | finder.expects(:recent).with(any_parameters).at_least_once |
490 | 490 | finder.expects(:recent).with('communities', anything).returns(recent_communities) |
491 | - CategoryFinder.expects(:new).with(@category).returns(finder) | |
491 | + CategoryFinder.stubs(:new).with(@category).returns(finder) | |
492 | 492 | |
493 | 493 | get :category_index, :category_path => [ 'my-category' ] |
494 | 494 | assert_same recent_communities, assigns(:results)[:communities] |
... | ... | @@ -499,7 +499,7 @@ class SearchControllerTest < ActionController::TestCase |
499 | 499 | finder = CategoryFinder.new(@category) |
500 | 500 | finder.expects(:recent).with(any_parameters).at_least_once |
501 | 501 | finder.expects(:recent).with('enterprises', anything).returns(recent_enterptises) |
502 | - CategoryFinder.expects(:new).with(@category).returns(finder) | |
502 | + CategoryFinder.stubs(:new).with(@category).returns(finder) | |
503 | 503 | |
504 | 504 | get :category_index, :category_path => [ 'my-category' ] |
505 | 505 | assert_same recent_enterptises, assigns(:results)[:enterprises] |
... | ... | @@ -987,7 +987,7 @@ class SearchControllerTest < ActionController::TestCase |
987 | 987 | most_commented = [art] |
988 | 988 | finder = CategoryFinder.new(@category) |
989 | 989 | finder.expects(:most_commented_articles).returns(most_commented) |
990 | - CategoryFinder.expects(:new).with(@category).returns(finder) | |
990 | + CategoryFinder.stubs(:new).with(@category).returns(finder) | |
991 | 991 | |
992 | 992 | get :category_index, :category_path => [ 'my-category' ] |
993 | 993 | assert_tag :tag => 'div', :attributes => {:class => /search-results-most_commented_articles/} , :descendant => {:tag => 'a', :attributes => { :href => '/search/index/my-category?asset=articles'}} | ... | ... |