Commit 771a059490b8136e38f5454d4348dc1c7ddf9d04
1 parent
91dd26a2
Exists in
master
and in
29 other branches
Add missing unit tests for the MainBlock
(ActionItem2914)
Showing
1 changed file
with
14 additions
and
0 deletions
Show diff stats
test/unit/main_block_test.rb
@@ -15,4 +15,18 @@ class MainBlockTest < ActiveSupport::TestCase | @@ -15,4 +15,18 @@ class MainBlockTest < ActiveSupport::TestCase | ||
15 | assert MainBlock.new.editable? | 15 | assert MainBlock.new.editable? |
16 | end | 16 | end |
17 | 17 | ||
18 | + should 'be visible on environment' do | ||
19 | + env = Environment.new | ||
20 | + block = MainBlock.new | ||
21 | + block.stubs(:owner).returns(env) | ||
22 | + assert block.visible? | ||
23 | + end | ||
24 | + | ||
25 | + should 'not be visible on environment' do | ||
26 | + env = Environment.new | ||
27 | + block = MainBlock.new(:display => 'never') | ||
28 | + block.stubs(:owner).returns(env) | ||
29 | + assert !block.visible? | ||
30 | + end | ||
31 | + | ||
18 | end | 32 | end |