Commit f14d60bfdd353a2fac08359411ad1de5bc0e09a1

Authored by Braulio Bhavamitra
1 parent d052d8e5

Remove tests for old behaviour in search

Showing 1 changed file with 0 additions and 54 deletions   Show diff stats
test/functional/search_controller_test.rb
... ... @@ -372,45 +372,6 @@ class SearchControllerTest < Test::Unit::TestCase
372 372 assert_tag :tag => 'div', :attributes => { :class => /search-results-people/ }, :descendant => { :tag => 'h3', :content => /People/ }
373 373 end
374 374  
375   - should 'present options of where to search' do
376   - get :popup
377   - names = {
378   - :articles => 'Articles',
379   - :people => 'People',
380   - :enterprises => 'Enterprises',
381   - :communities => 'Communities',
382   - :products => 'Products',
383   - :events => 'Events',
384   - }
385   - names.each do |thing,description|
386   - assert_tag :tag => 'input', :attributes => { :type => 'checkbox', :name => "find_in[]", :value => thing.to_s, :checked => 'checked' }
387   - assert_tag :tag => 'label', :content => description
388   - end
389   - end
390   -
391   - should 'not display option to choose where to search when not inside filter' do
392   - get :popup
393   - assert_no_tag :tag => 'input', :attributes => { :type => 'radio', :name => 'search_whole_site', :value => 'yes' }
394   - end
395   -
396   - should 'display option to choose searching in whole site or in current category' do
397   - parent = Category.create!(:name => 'cat', :environment => Environment.default)
398   - Category.create!(:name => 'sub', :environment => Environment.default, :parent => parent)
399   -
400   - get :popup, :category_path => [ 'cat', 'sub']
401   - assert_tag :tag => 'input', :attributes => { :type => 'submit', :name => 'search_whole_site_yes' }
402   - assert_tag :tag => 'input', :attributes => { :type => 'submit', :name => 'search_whole_site_no' }
403   - end
404   -
405   - should 'display option to search within a given point and distance' do
406   - state = State.create!(:name => "Bahia", :environment => Environment.default)
407   - get :popup
408   -
409   - assert_tag :tag => 'select', :attributes => {:name => 'radius'}
410   - assert_tag :tag => 'select', :attributes => {:name => 'state'}
411   - assert_tag :tag => 'select', :attributes => {:name => 'city'}
412   - end
413   -
414 375 should 'search in whole site when told so' do
415 376 parent = Category.create!(:name => 'randomcat', :environment => Environment.default)
416 377 Category.create!(:name => 'randomchild', :environment => Environment.default, :parent => parent)
... ... @@ -421,21 +382,6 @@ class SearchControllerTest < Test::Unit::TestCase
421 382 assert_redirected_to :action => 'index', :category_path => [], :query => 'some random query', :search_whole_site => nil
422 383 end
423 384  
424   - should 'submit form to root when not inside a filter' do
425   - get :popup
426   - assert_tag :tag => 'form', :attributes => { :action => '/search' }
427   - end
428   -
429   - should 'submit form to category path when inside a filter' do
430   - get :popup, :category_path => Category.create!(:name => 'mycat', :environment => Environment.default).explode_path
431   - assert_tag :tag => 'form', :attributes => { :action => '/search/index/mycat' }
432   - end
433   -
434   - should 'use GET method to search' do
435   - get :popup
436   - assert_tag :tag => 'form' , :attributes => { :method => 'get' }
437   - end
438   -
439 385 should 'display a given category' do
440 386 get :category_index, :category_path => [ 'my-category' ]
441 387 assert_equal @category, assigns(:category)
... ...