Commit bf5b298ee77b683000eab2db28d8a2524966e219
1 parent
eb070c85
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
fixing merge with master tests
Showing
1 changed file
with
4 additions
and
61 deletions
Show diff stats
test/functional/environment_design_controller_test.rb
... | ... | @@ -233,61 +233,10 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
233 | 233 | |
234 | 234 | Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) |
235 | 235 | login_as(create_admin_user(Environment.default)) |
236 | - get :add_block | |
237 | - | |
238 | - assert_response :success | |
239 | - assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) | |
240 | - assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
241 | - assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
242 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
243 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock5) | |
244 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock6) | |
245 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock7) | |
246 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock8) | |
247 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock9) | |
248 | - end | |
249 | - | |
250 | - should 'a block plugin with side position add new blocks only in this position' do | |
251 | - class CustomBlock1 < Block; end; | |
252 | - class CustomBlock2 < Block; end; | |
253 | - class CustomBlock3 < Block; end; | |
254 | - class CustomBlock4 < Block; end; | |
255 | - class CustomBlock5 < Block; end; | |
256 | - class CustomBlock6 < Block; end; | |
257 | - class CustomBlock7 < Block; end; | |
258 | - class CustomBlock8 < Block; end; | |
259 | - class CustomBlock9 < Block; end; | |
260 | - | |
261 | - class TestBlockPlugin < Noosfero::Plugin | |
262 | - def self.extra_blocks | |
263 | - { | |
264 | - CustomBlock1 => {:type => Environment, :position => [1]}, | |
265 | - CustomBlock2 => {:type => Environment, :position => 1}, | |
266 | - CustomBlock3 => {:type => Environment, :position => '1'}, | |
267 | - CustomBlock4 => {:type => Environment, :position => [2]}, | |
268 | - CustomBlock5 => {:type => Environment, :position => 2}, | |
269 | - CustomBlock6 => {:type => Environment, :position => '2'}, | |
270 | - CustomBlock7 => {:type => Environment, :position => [3]}, | |
271 | - CustomBlock8 => {:type => Environment, :position => 3}, | |
272 | - CustomBlock9 => {:type => Environment, :position => '3'}, | |
273 | - } | |
274 | - end | |
275 | - end | |
276 | - | |
277 | - Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([TestBlockPlugin.new]) | |
278 | - login_as(create_admin_user(Environment.default)) | |
279 | - get :add_block | |
236 | + get :index | |
280 | 237 | assert_response :success |
281 | 238 | |
282 | - refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock1) | |
283 | - refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock2) | |
284 | - refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock3) | |
285 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock4) | |
286 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) | |
287 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
288 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
289 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) | |
290 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock9) | |
239 | + (1..9).each {|i| assert_tag :tag => 'div', :attributes => { 'data-block-type' => "EnvironmentDesignControllerTest::CustomBlock#{i}" }} | |
291 | 240 | end |
292 | 241 | |
293 | 242 | should 'a block plugin cannot be listed for unspecified types' do |
... | ... | @@ -320,14 +269,8 @@ class EnvironmentDesignControllerTest < ActionController::TestCase |
320 | 269 | get :index |
321 | 270 | assert_response :success |
322 | 271 | |
323 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock1) | |
324 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock2) | |
325 | - refute @controller.instance_variable_get('@center_block_types').include?(CustomBlock3) | |
326 | - assert @controller.instance_variable_get('@center_block_types').include?(CustomBlock4) | |
327 | - refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock5) | |
328 | - refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock6) | |
329 | - refute @controller.instance_variable_get('@side_block_types').include?(CustomBlock7) | |
330 | - assert @controller.instance_variable_get('@side_block_types').include?(CustomBlock8) | |
272 | + [4, 8].each {|i| assert_tag :tag => 'div', :attributes => { 'data-block-type' => "EnvironmentDesignControllerTest::CustomBlock#{i}" }} | |
273 | + [1, 2, 3, 5, 6, 7].each {|i| assert_no_tag :tag => 'div', :attributes => { 'data-block-type' => "EnvironmentDesignControllerTest::CustomBlock#{i}" }} | |
331 | 274 | end |
332 | 275 | |
333 | 276 | should 'clone a block' do | ... | ... |