From b0512b434a9c57b854f935d24b23e2f90d953f98 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Mon, 25 Aug 2014 18:16:19 -0300 Subject: [PATCH] refactoring preview_path method --- test/unit/block_test.rb | 11 ++--------- test/unit/box_organizer_helper_test.rb | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/test/unit/block_test.rb b/test/unit/block_test.rb index 3c61c88..e5989cf 100644 --- a/test/unit/block_test.rb +++ b/test/unit/block_test.rb @@ -292,11 +292,9 @@ class BlockTest < ActiveSupport::TestCase assert Block.respond_to?(:pretty_name) end - should 'previews_path return the array of preview images' do + should 'previews_path return the apth to preview images' do class NewBlock < Block; end - expected = ['path/1', 'path/2'] - Dir.expects(:glob).with('blocks/new_block/previews/*').returns(expected) - assert_equivalent expected, NewBlock.previews_path + assert_equal 'blocks/new_block/previews', NewBlock.preview_path end should 'return the icon block path' do @@ -319,9 +317,4 @@ class BlockTest < ActiveSupport::TestCase assert_equal 'block_preview.png', NewBlock.default_preview_path end - should 'previews_path return an empty array if there is no preview image' do - class NewBlock < Block; end - assert_equivalent [], NewBlock.previews_path - end - end diff --git a/test/unit/box_organizer_helper_test.rb b/test/unit/box_organizer_helper_test.rb index 0e3946b..7c785ad 100644 --- a/test/unit/box_organizer_helper_test.rb +++ b/test/unit/box_organizer_helper_test.rb @@ -131,8 +131,6 @@ class BoxOrganizerHelperTest < ActionView::TestCase assert_match 'plugins/some/images/blocks/some_block/icon.png', display_icon(block) end -########################################## - should 'display the default preview for block without previews images' do class SomeBlock < Block; end block = SomeBlock -- libgit2 0.21.2