From 771a059490b8136e38f5454d4348dc1c7ddf9d04 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Mon, 13 Jan 2014 22:38:32 -0300 Subject: [PATCH] Add missing unit tests for the MainBlock --- test/unit/main_block_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+), 0 deletions(-) diff --git a/test/unit/main_block_test.rb b/test/unit/main_block_test.rb index 0a84be2..8e2ca04 100644 --- a/test/unit/main_block_test.rb +++ b/test/unit/main_block_test.rb @@ -15,4 +15,18 @@ class MainBlockTest < ActiveSupport::TestCase assert MainBlock.new.editable? end + should 'be visible on environment' do + env = Environment.new + block = MainBlock.new + block.stubs(:owner).returns(env) + assert block.visible? + end + + should 'not be visible on environment' do + env = Environment.new + block = MainBlock.new(:display => 'never') + block.stubs(:owner).returns(env) + assert !block.visible? + end + end -- libgit2 0.21.2