Browse Source

Added test for correct mangling of response when route extension added but no view class set.

sam-at-github 12 years ago
parent
commit
13f47baa34
1 changed files with 13 additions and 0 deletions
  1. 13 0
      tests/TestCase/Controller/Component/RequestHandlerComponentTest.php

+ 13 - 0
tests/TestCase/Controller/Component/RequestHandlerComponentTest.php

@@ -394,6 +394,19 @@ class RequestHandlerComponentTest extends TestCase {
 	}
 
 /**
+ * test configured extension but no view class set.
+ */
+	public function testNoViewClassExtension() {
+		Router::parseExtensions('json', 'xml', 'ajax', 'csv');
+		$this->Controller->request->params['_ext'] = 'csv';
+		$event = new Event('Controller.startup', $this->Controller);
+		$this->RequestHandler->initialize($event);
+		$this->RequestHandler->startup($event);
+		$this->assertEquals('RequestHandlerTest/csv', $this->Controller->viewPath);
+		$this->assertEquals('csv', $this->Controller->layoutPath);
+	}
+
+/**
  * testStartupCallback method
  *
  * @return void