Commit bf6229859a0281d106223eec6c306c7c927acbed

Authored by Rafael Martins
1 parent 92d1163f

Integration tests moved to the new search actions

test/integration/assets_menu_test.rb
... ... @@ -3,8 +3,8 @@ require "#{File.dirname(__FILE__)}/../test_helper"
3 3 class AssetsMenuTest < ActionController::IntegrationTest
4 4  
5 5 def setup
6   - HomeController.any_instance.stubs(:get_layout).returns('application')
7   - SearchController.any_instance.stubs(:get_layout).returns('application')
  6 +# HomeController.any_instance.stubs(:get_layout).returns('application')
  7 +# SearchController.any_instance.stubs(:get_layout).returns('application')
8 8  
9 9 parent = Category.create!(:name => "Parent Category", :environment => Environment.default, :display_color => 1)
10 10 @category = Category.create!(:name => "Category A", :environment => Environment.default, :parent => parent)
... ... @@ -12,17 +12,14 @@ class AssetsMenuTest &lt; ActionController::IntegrationTest
12 12  
13 13 should 'link to uncategorized assets at site root' do
14 14 get '/'
15   - assert_tag :tag => 'a', :attributes => { :href => '/assets/articles' }
  15 + assert_tag :tag => 'a', :attributes => { :href => '/search/contents' }
16 16 end
17 17  
18 18 should 'link to assets inside category root' do
  19 + ent = @category.enterprises.create! :identifier => 'ent1', :name => 'enterprise1'
  20 +
19 21 get '/cat/parent-category/category-a'
20   - assert_tag :tag => 'a', :attributes => { :href => '/assets/articles/parent-category/category-a' }
21   - end
22   -
23   - should 'link to other assets in same category when' do
24   - get '/assets/articles/parent-category/category-a'
25   - assert_tag :tag => 'a', :attributes => { :href => '/assets/products/parent-category/category-a' }
  22 + assert_tag :tag => 'a', :attributes => { :href => '/search/enterprises/parent-category/category-a' }
26 23 end
27 24  
28 25 end
... ...
test/integration/categories_menu_test.rb
... ... @@ -25,16 +25,10 @@ class CategoriesMenuTest &lt; ActionController::IntegrationTest
25 25 assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } }
26 26 end
27 27  
28   - should 'link to other assets in the same category when viewing an asset' do
29   - get '/assets/articles/food/vegetables'
30   - assert_no_tag :attributes => { :id => 'assets_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } }
31   - assert_tag :attributes => { :id => 'assets_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/assets/enterprises/food/vegetables' } }
32   - end
33   -
34 28 should "always link to category's initial page in category menu" do
35   - get '/assets/products/food/vegetables'
  29 + get '/search/products/food/vegetables'
36 30 assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } }
37   - assert_no_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/assets/products/food/vegetables' } }
  31 + assert_no_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/searchh/products/food/vegetables' } }
38 32 end
39 33  
40 34 should 'cache the categories menu' do
... ...