Commit e59c8ae2a2c1366e562831c6b6d15d87c71b99f4
1 parent
0cddc2c3
Exists in
master
and in
29 other branches
product-categories-block: not visible when products are disabled on the environment
Showing
2 changed files
with
20 additions
and
0 deletions
Show diff stats
app/models/product_categories_block.rb
... | ... | @@ -0,0 +1,16 @@ |
1 | +require File.dirname(__FILE__) + '/../test_helper' | |
2 | + | |
3 | +class ProductCategoriesBlockTest < ActiveSupport::TestCase | |
4 | + should 'not be visible if products are disabled on the environment ' do | |
5 | + enterprise = fast_create(Enterprise) | |
6 | + box = fast_create(Box, :owner_id => enterprise.id, :owner_type => 'Profile') | |
7 | + block = ProductCategoriesBlock.new | |
8 | + block.box = box | |
9 | + | |
10 | + block.box.environment.enable('products_for_enterprises') | |
11 | + assert block.visible? | |
12 | + | |
13 | + block.box.environment.disable('products_for_enterprises') | |
14 | + assert !block.visible? | |
15 | + end | |
16 | +end | ... | ... |