Make OCS intergration tests check for CSP

* Very hacky in simple test but at least we test
This commit is contained in:
Roeland Jago Douma 2016-09-15 12:41:39 +02:00
parent 6dace7f6ad
commit e392f669c0
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
2 changed files with 25 additions and 0 deletions

View File

@ -514,5 +514,28 @@ trait Sharing {
throw new \Exception('Expected the same link share to be returned');
}
}
/**
* @Then The following headers should be set
* @param \Behat\Gherkin\Node\TableNode $table
* @throws \Exception
*/
public function theFollowingHeadersShouldBeSet(\Behat\Gherkin\Node\TableNode $table) {
foreach($table->getTable() as $header) {
$headerName = $header[0];
$expectedHeaderValue = $header[1];
$returnedHeader = $this->response->getHeader($headerName);
if($returnedHeader !== $expectedHeaderValue) {
throw new \Exception(
sprintf(
"Expected value '%s' for header '%s', got '%s'",
$expectedHeaderValue,
$headerName,
$returnedHeader
)
);
}
}
}
}

View File

@ -13,6 +13,8 @@ Feature: sharing
| shareType | 0 |
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And The following headers should be set
| Content-Security-Policy | default-src 'none' |
Scenario: Creating a share with a group
Given user "user0" exists