Commit b0512b434a9c57b854f935d24b23e2f90d953f98

Authored by Leandro Santos
1 parent 888d94d7

refactoring preview_path method

test/unit/block_test.rb
... ... @@ -292,11 +292,9 @@ class BlockTest < ActiveSupport::TestCase
292 292 assert Block.respond_to?(:pretty_name)
293 293 end
294 294  
295   - should 'previews_path return the array of preview images' do
  295 + should 'previews_path return the apth to preview images' do
296 296 class NewBlock < Block; end
297   - expected = ['path/1', 'path/2']
298   - Dir.expects(:glob).with('blocks/new_block/previews/*').returns(expected)
299   - assert_equivalent expected, NewBlock.previews_path
  297 + assert_equal 'blocks/new_block/previews', NewBlock.preview_path
300 298 end
301 299  
302 300 should 'return the icon block path' do
... ... @@ -319,9 +317,4 @@ class BlockTest &lt; ActiveSupport::TestCase
319 317 assert_equal 'block_preview.png', NewBlock.default_preview_path
320 318 end
321 319  
322   - should 'previews_path return an empty array if there is no preview image' do
323   - class NewBlock < Block; end
324   - assert_equivalent [], NewBlock.previews_path
325   - end
326   -
327 320 end
... ...
test/unit/box_organizer_helper_test.rb
... ... @@ -131,8 +131,6 @@ class BoxOrganizerHelperTest &lt; ActionView::TestCase
131 131 assert_match 'plugins/some/images/blocks/some_block/icon.png', display_icon(block)
132 132 end
133 133  
134   -##########################################
135   -
136 134 should 'display the default preview for block without previews images' do
137 135 class SomeBlock < Block; end
138 136 block = SomeBlock
... ...