Commit 38d051549d8dc6dbb4ed0ff591872d6d29410117
1 parent
c9eccb09
Exists in
master
and in
29 other branches
container_block: unnecessary tests removed
Showing
3 changed files
with
0 additions
and
95 deletions
Show diff stats
plugins/container_block/test/unit/block_test.rb
@@ -1,31 +0,0 @@ | @@ -1,31 +0,0 @@ | ||
1 | -require 'test_helper' | ||
2 | - | ||
3 | -class BlockTest < ActiveSupport::TestCase | ||
4 | - | ||
5 | - def setup | ||
6 | - @environment = fast_create(Environment) | ||
7 | - @box = Box.create!(:owner => @environment) | ||
8 | - @container = ContainerBlockPlugin::ContainerBlock.create!(:box => @box) | ||
9 | - end | ||
10 | - | ||
11 | - should 'return environment box if block owner is not a ContainerBlock' do | ||
12 | - block = Block.create!(:box => @box) | ||
13 | - assert_equal @box, block.box | ||
14 | - end | ||
15 | - | ||
16 | - should 'return container box if block owner is a ContainerBlock' do | ||
17 | - block = Block.create!(:box => @container.container_box) | ||
18 | - assert_equal @container.container_box, block.box | ||
19 | - end | ||
20 | - | ||
21 | - should 'return block owner if block onwer is not a ContainerBlock' do | ||
22 | - block = Block.create!(:box => @box) | ||
23 | - assert_equal @environment, block.owner | ||
24 | - end | ||
25 | - | ||
26 | - should 'return environment as owner if block onwer is a ContainerBlock' do | ||
27 | - block = Block.create!(:box => @container.container_box) | ||
28 | - assert_equal @environment, block.owner | ||
29 | - end | ||
30 | - | ||
31 | -end |
plugins/container_block/test/unit/environment_test.rb
@@ -1,32 +0,0 @@ | @@ -1,32 +0,0 @@ | ||
1 | -require 'test_helper' | ||
2 | - | ||
3 | -class EnvironmentTest < ActiveSupport::TestCase | ||
4 | - | ||
5 | - def setup | ||
6 | - @environment = fast_create(Environment) | ||
7 | - | ||
8 | - @box = Box.create!(:owner => @environment) | ||
9 | - @block = Block.create!(:box => @box) | ||
10 | - | ||
11 | - @container = ContainerBlockPlugin::ContainerBlock.create!(:box => @box) | ||
12 | - end | ||
13 | - | ||
14 | - should 'return blocks as usual' do | ||
15 | - assert_equal [@block, @container], @environment.blocks | ||
16 | - end | ||
17 | - | ||
18 | - should 'return blocks with container children' do | ||
19 | - child = Block.create!(:box => @container.container_box) | ||
20 | - assert_equal [@block, @container, child], @environment.blocks | ||
21 | - end | ||
22 | - | ||
23 | - should 'return block with id at find method' do | ||
24 | - assert_equal @block, @environment.blocks.find(@block.id) | ||
25 | - end | ||
26 | - | ||
27 | - should 'return child block with id at find method' do | ||
28 | - child = Block.create!(:box => @container.container_box) | ||
29 | - assert_equal child, @environment.blocks.find(child.id) | ||
30 | - end | ||
31 | - | ||
32 | -end |
plugins/container_block/test/unit/profile_test.rb
@@ -1,32 +0,0 @@ | @@ -1,32 +0,0 @@ | ||
1 | -require 'test_helper' | ||
2 | - | ||
3 | -class ProfileTest < ActiveSupport::TestCase | ||
4 | - | ||
5 | - def setup | ||
6 | - @profile = fast_create(Profile) | ||
7 | - | ||
8 | - @box = Box.create!(:owner => @profile) | ||
9 | - @block = Block.create!(:box => @box) | ||
10 | - | ||
11 | - @container = ContainerBlockPlugin::ContainerBlock.create!(:box => @box) | ||
12 | - end | ||
13 | - | ||
14 | - should 'return blocks as usual' do | ||
15 | - assert_equal [@block, @container], @profile.blocks | ||
16 | - end | ||
17 | - | ||
18 | - should 'return blocks with container children' do | ||
19 | - child = Block.create!(:box => @container.container_box) | ||
20 | - assert_equal [@block, @container, child], @profile.blocks | ||
21 | - end | ||
22 | - | ||
23 | - should 'return block with id at find method' do | ||
24 | - assert_equal @block, @profile.blocks.find(@block.id) | ||
25 | - end | ||
26 | - | ||
27 | - should 'return child block with id at find method' do | ||
28 | - child = Block.create!(:box => @container.container_box) | ||
29 | - assert_equal child, @profile.blocks.find(child.id) | ||
30 | - end | ||
31 | - | ||
32 | -end |