diff --git a/library/ZendAfi/View/Helper/RenderWidgetTemplates.php b/library/ZendAfi/View/Helper/RenderWidgetTemplates.php index 076fa1514b6f5240c80f7f6baa548afa40d977a1..9687f725f5423e51a0c463818c2e6e81fb09e89f 100644 --- a/library/ZendAfi/View/Helper/RenderWidgetTemplates.php +++ b/library/ZendAfi/View/Helper/RenderWidgetTemplates.php @@ -62,7 +62,8 @@ class ZendAfi_View_Helper_RenderWidgetTemplates extends ZendAfi_View_Helper_Base 'controller' => 'widget', 'action' => 'add', 'template' => $section_key, - 'template_no' => $template_index]); + 'template_no' => $template_index, + 'render' => null]); return $this->_tag('a', $this->_tag('h4', $template['title']) . diff --git a/tests/application/modules/admin/controllers/WidgetControllerTest.php b/tests/application/modules/admin/controllers/WidgetControllerTest.php index 8f102ffd0b6e2efb4e5f47ecf149aad5106f6add..90cb79a7f4ded853060599c0840047518a13ac1e 100644 --- a/tests/application/modules/admin/controllers/WidgetControllerTest.php +++ b/tests/application/modules/admin/controllers/WidgetControllerTest.php @@ -2110,6 +2110,31 @@ class WidgetControllerAddActionEmptyPostDispatchTest extends WidgetControllerWid +class WidgetControllerWidgetAddFromTemplateInPopupTest extends WidgetControllerWidgetConfigurationTestCase { + protected $_json; + + public function setUp() { + parent::setUp(); + $this->dispatch('admin/widget/add-from-template/id_profil/2/render/popup', true); + $this->_json = json_decode($this->_response->getBody()); + } + + + /** @test */ + public function titleShouldBeAddAWidget() { + $this->assertEquals('Ajouter une boîte', $this->_json->title); + } + + + /** @test */ + public function addActionShouldNotContainsRenderPopup() { + $this->assertNotContains('/render/popup', $this->_json->content); + } +} + + + + class WidgetControllerWidgetAddFromTemplateTest extends WidgetControllerWidgetConfigurationTestCase { public function setUp() { parent::setUp();