Skip to content
Snippets Groups Projects
Commit 7b45e4de authored by Meusburger's avatar Meusburger
Browse files

Merge branch 'hotline#11217_album_indexation' into 'stable'

Hotline#11217 album indexation

See merge request !1032
parents 5adf27a7 3bc125fc
Branches
Tags
2 merge requests!1046Master,!1045Hotline master
* ticket #11217 : indexation à la volée des notices de la bibliothèque numérique.
\ No newline at end of file
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_UploadController extends Zend_Controller_Action {
public function preDispatch(){
......@@ -65,8 +65,11 @@ $(document).ready(function () {
return;
}
$this->_helper->json($model->addFile($this->_request));
$result = $model->addFile($this->_request);
$model->save();
$model->index();
$this->_helper->json($result);
return;
}
......
......@@ -42,6 +42,9 @@ class UploadControllerMultipleActionTest extends AbstractControllerTestCase {
class UploadControllerMultipleProcessPostAction extends AbstractControllerTestCase {
protected
$_storm_default_to_volatile=true;
/** @test */
public function withEmptyRequestResponseShouldContainError() {
$this->dispatch('/admin/upload/multiple-process');
......@@ -95,6 +98,7 @@ class UploadControllerMultipleProcessPostAction extends AbstractControllerTestCa
public function withModelShouldCallFileProcessingMethod() {
$album = Storm_Test_ObjectWrapper::on(Class_Album::getLoader()->newInstance())
->whenCalled('addFile')->answers(array('success' => 'true'))
->whenCalled('index')->answers(null)
->getWrapper();
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Album')
......@@ -130,6 +134,15 @@ class UploadControllerMultipleProcessPostAction extends AbstractControllerTestCa
}
/**
* @depends withModelShouldCallFileProcessingMethod
* @test
*/
public function albumShouldHaveBeenIndexed($album) {
$this->assertTrue($album->methodHasBeenCalled('index'));
}
/**
* @depends withModelShouldCallFileProcessingMethod
* @test
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment