Commit 126613b1059b30646b64d27570108642a601a17e
1 parent
474f1f82
Exists in
master
and in
29 other branches
Remove integration test for deprecated layout
Showing
1 changed file
with
0 additions
and
41 deletions
Show diff stats
test/integration/categories_menu_test.rb
@@ -1,41 +0,0 @@ | @@ -1,41 +0,0 @@ | ||
1 | -require_relative "../test_helper" | ||
2 | - | ||
3 | -class CategoriesMenuTest < ActionController::IntegrationTest | ||
4 | - | ||
5 | - def setup | ||
6 | - HomeController.any_instance.stubs(:get_layout).returns('application') | ||
7 | - SearchController.any_instance.stubs(:get_layout).returns('application') | ||
8 | - | ||
9 | - Category.delete_all | ||
10 | - @cat1 = Category.create!(:display_in_menu => true, :name => 'Food', :environment => Environment.default, :display_color => '#888a85') | ||
11 | - @cat2 = Category.create!(:display_in_menu => true, :name => 'Vegetables', :environment => Environment.default, :parent => @cat1) | ||
12 | - | ||
13 | - # all categories must be shown for these tests | ||
14 | - Category.any_instance.stubs(:display_in_menu?).returns(true) | ||
15 | - end | ||
16 | - | ||
17 | - should 'display link to categories' do | ||
18 | - get '/' | ||
19 | - assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } } | ||
20 | - end | ||
21 | - | ||
22 | - should 'display link to sub-categories' do | ||
23 | - get '/cat/food' | ||
24 | - # there must be a link to the subcategory | ||
25 | - assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } } | ||
26 | - end | ||
27 | - | ||
28 | - should "always link to category's initial page in category menu" do | ||
29 | - get '/search/products/food/vegetables' | ||
30 | - assert_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/cat/food/vegetables' } } | ||
31 | - assert_no_tag :attributes => { :id => 'cat_menu' }, :descendant => { :tag => 'a', :attributes => { :href => '/searchh/products/food/vegetables' } } | ||
32 | - end | ||
33 | - | ||
34 | - should 'cache the categories menu' do | ||
35 | - ActionController::Base.perform_caching = true | ||
36 | - HomeController.any_instance.stubs(:fragment_cache_key).with(Environment.default.id.to_s + "_categories_menu").returns('dir') | ||
37 | - get '/' | ||
38 | - ActionController::Base.perform_caching = false | ||
39 | - end | ||
40 | - | ||
41 | -end |