Skip to content
Permalink
Browse files

add test to prove requesthandler works correct with Angular wonky acc…

…ept headers
  • Loading branch information...
ceeram committed Oct 2, 2014
1 parent 5582edf commit 8507ef83f175bbf3f6532dc68b6051f0d41acd82
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
@@ -197,6 +197,20 @@ public function testInitializeContentTypeWithjQueryAccept() {
$this->assertEquals('json', $this->RequestHandler->ext);
}
/**
* Test that RequestHandler sets $this->ext when Angular sends its wonky-ish headers.
*
* @return void
*/
public function testInitializeContentTypeWithAngularAccept() {
$_SERVER['HTTP_ACCEPT'] = 'application/json, text/plain, * / *';
$this->assertNull($this->RequestHandler->ext);
Router::parseExtensions('json');
$this->RequestHandler->initialize($this->Controller);
$this->assertEquals('json', $this->RequestHandler->ext);
}
/**
* Test that RequestHandler sets $this->ext when jQuery sends its wonky-ish headers
* and the application is configured to handle multiple extensions

0 comments on commit 8507ef8

Please sign in to comment.
You can’t perform that action at this time.