Fixing test case as it was error prone. Assuming the first value of $plugins array to be 'plugin_js' was incorrect.

This commit is contained in:
ADmad 2010-07-31 21:08:10 +05:30
parent 373bebb128
commit d04b327469

View file

@ -1786,7 +1786,7 @@ class RouterTest extends CakeTestCase {
*/
function testUrlWritingWithPrefixesAndCustomRoutes() {
Router::connect(
'/admin/login',
'/admin/login',
array('controller' => 'users', 'action' => 'login', 'prefix' => 'admin', 'admin' => true)
);
Router::setRequestInfo(array(
@ -2007,9 +2007,7 @@ class RouterTest extends CakeTestCase {
App::objects('plugin', null, false);
Router::reload();
$plugins = App::objects('plugin');
$plugin = Inflector::underscore($plugins[0]);
$result = Router::url(array('plugin' => $plugin, 'controller' => 'js_file', 'action' => 'index'));
$result = Router::url(array('plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index'));
$this->assertEqual($result, '/plugin_js/js_file');
$result = Router::parse('/plugin_js/js_file');