Commit 83975a05 authored by Sergio Bertolin's avatar Sergio Bertolin

Added tests including files properties

parent 1d4fcf95
......@@ -327,6 +327,15 @@ trait WebDav {
$value = $value[0];
}
}
if ($expectedValue === "a_comment_url"){
if (preg_match("#^/remote.php/dav/comments/files/([0-9]+)$#", $value)) {
return 0;
} else {
throw new \Exception("Property \"$key\" found with value \"$value\", expected \"$expectedValue\"");
}
}
if ($value != $expectedValue) {
throw new \Exception("Property \"$key\" found with value \"$value\", expected \"$expectedValue\"");
}
......
......@@ -88,4 +88,19 @@ Feature: Comments
When user "user0" edits last comment with content "User1 edited comment"
Then the HTTP status code should be "403"
And user "user0" should have the following comments on file "/myFileToComment.txt"
| user1 | Sharee comment |
\ No newline at end of file
| user1 | Sharee comment |
Scenario: Getting info of comments using files endpoint
Given user "user0" exists
And As an "user0"
And User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
And user "user0" comments with content "My first comment" on file "/myFileToComment.txt"
And user "user0" should have the following comments on file "/myFileToComment.txt"
| user0 | My first comment |
When as "user0" gets properties of folder "/myFileToComment.txt" with
| {http://owncloud.org/ns}comments-href |
| {http://owncloud.org/ns}comments-count |
| {http://owncloud.org/ns}comments-unread |
#Then the single response should contain a property "{http://owncloud.org/ns}comments-count" with value "1"
And the single response should contain a property "{http://owncloud.org/ns}comments-unread" with value "0"
And the single response should contain a property "{http://owncloud.org/ns}comments-href" with value "a_comment_url"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment