From bf6229859a0281d106223eec6c306c7c927acbed Mon Sep 17 00:00:00 2001 From: Rafael Martins Date: Fri, 24 Feb 2012 17:23:47 -0200 Subject: [PATCH] Integration tests moved to the new search actions --- test/integration/assets_menu_test.rb | 15 ++++++--------- test/integration/categories_menu_test.rb | 10 ++-------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/test/integration/assets_menu_test.rb b/test/integration/assets_menu_test.rb index 133f12b..68ecc05 100644 --- a/test/integration/assets_menu_test.rb +++ b/test/integration/assets_menu_test.rb @@ -3,8 +3,8 @@ require "#{File.dirname(__FILE__)}/../test_helper" class AssetsMenuTest < ActionController::IntegrationTest def setup - HomeController.any_instance.stubs(:get_layout).returns('application') - SearchController.any_instance.stubs(:get_layout).returns('application') +# HomeController.any_instance.stubs(:get_layout).returns('application') +# SearchController.any_instance.stubs(:get_layout).returns('application') parent = Category.create!(:name => "Parent Category", :environment => Environment.default, :display_color => 1) @category = Category.create!(:name => "Category A", :environment => Environment.default, :parent => parent) @@ -12,17 +12,14 @@ class AssetsMenuTest < ActionController::IntegrationTest should 'link to uncategorized assets at site root' do get '/' - assert_tag :tag => 'a', :attributes => { :href => '/assets/articles' } + assert_tag :tag => 'a', :attributes => { :href => '/search/contents' } end should 'link to assets inside category root' do + ent = @category.enterprises.create! :identifier => 'ent1', :name => 'enterprise1' + get '/cat/parent-category/category-a' - assert_tag :tag => 'a', :attributes => { :href => '/assets/articles/parent-category/category-a' } - end - - should 'link to other assets in same category when' do - get '/assets/articles/parent-category/category-a' - assert_tag :tag => 'a', :attributes => { :href => '/assets/products/parent-category/category-a' } + assert_tag :tag => 'a', :attributes => { :href => '/search/enterprises/parent-category/category-a' } end end diff --git a/test/integration/categories_menu_test.rb b/test/integration/categories_menu_test.rb index 5fa1376..cc22fb3 100644 --- a/test/integration/categories_menu_test.rb +++ b/test/integration/categories_menu_test.rb @@ -25,16 +25,10 @@ class CategoriesMenuTest < ActionController::IntegrationTest assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } } end - should 'link to other assets in the same category when viewing an asset' do - get '/assets/articles/food/vegetables' - assert_no_tag :attributes => { :id => 'assets_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } } - assert_tag :attributes => { :id => 'assets_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/assets/enterprises/food/vegetables' } } - end - should "always link to category's initial page in category menu" do - get '/assets/products/food/vegetables' + get '/search/products/food/vegetables' assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } } - assert_no_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/assets/products/food/vegetables' } } + assert_no_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/searchh/products/food/vegetables' } } end should 'cache the categories menu' do -- libgit2 0.21.2