Skip to content

Commit

Permalink
add test to prove requesthandler works correct with Angular wonky acc…
Browse files Browse the repository at this point in the history
…ept headers
  • Loading branch information
ceeram committed Oct 2, 2014
1 parent 5582edf commit 8507ef8
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit 8507ef8

Please sign in to comment.