123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- Feature: comments
- Scenario: Creating a comment on a file belonging to myself
- Given user "user0" exists
- Given As an "user0"
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- When "user0" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- Then As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user0"
- And the response should contain only "1" comments
- Scenario: Creating a comment on a shared file belonging to another user
- Given user "user0" exists
- Given user "12345" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
- | path | myFileToComment.txt |
- | shareWith | 12345 |
- | shareType | 0 |
- When "12345" posts a comment with content "A comment from another user" on the file named "/myFileToComment.txt" it should return "201"
- Then As "12345" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "A comment from another user"
- And the response should contain a property "oc:actorDisplayName" with value "12345"
- And the response should contain only "1" comments
- Scenario: Creating a comment on a non-shared file belonging to another user
- Given user "user0" exists
- Given user "user1" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Then "user1" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "404"
- Scenario: Reading comments on a non-shared file belonging to another user
- Given user "user0" exists
- Given user "user1" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Then As "user1" load all the comments of the file named "/myFileToComment.txt" it should return "404"
- Scenario: Deleting my own comments on a file belonging to myself
- Given user "user0" exists
- Given As an "user0"
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given "user0" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- When As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- Then the response should contain a property "oc:parentId" with value "0"
- Then the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user0"
- And the response should contain only "1" comments
- And As "user0" delete the created comment it should return "204"
- And As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain only "0" comments
- Scenario: Deleting my own comments on a file shared by somebody else
- Given user "user0" exists
- Given user "user1" exists
- Given As an "user0"
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
- | path | myFileToComment.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given "user1" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- When As "user1" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- Then the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- And the response should contain only "1" comments
- And As "user1" delete the created comment it should return "204"
- And As "user1" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain only "0" comments
- Scenario: Deleting my own comments on a file unshared by someone else
- Given user "user0" exists
- Given user "user1" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
- | path | myFileToComment.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given "user1" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- When As "user1" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- Then the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- And the response should contain only "1" comments
- And As "user0" remove all shares from the file named "/myFileToComment.txt"
- And As "user1" delete the created comment it should return "404"
- And As "user1" load all the comments of the file named "/myFileToComment.txt" it should return "404"
- Scenario: Edit my own comments on a file belonging to myself
- Given user "user0" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given "user0" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- When As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- Then the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user0"
- And the response should contain only "1" comments
- When As "user0" edit the last created comment and set text to "My edited comment" it should return "207"
- Then As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My edited comment"
- And the response should contain a property "oc:actorDisplayName" with value "user0"
- Scenario: Edit my own comments on a file shared by someone with me
- Given user "user0" exists
- Given user "user1" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
- | path | myFileToComment.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given "user1" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- When As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- Then the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- And the response should contain only "1" comments
- Given As "user1" edit the last created comment and set text to "My edited comment" it should return "207"
- Then As "user1" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My edited comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- Scenario: Edit my own comments on a file unshared by someone with me
- Given user "user0" exists
- Given user "user1" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
- | path | myFileToComment.txt |
- | shareWith | user1 |
- | shareType | 0 |
- When "user1" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- Then As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- And the response should contain only "1" comments
- And As "user0" remove all shares from the file named "/myFileToComment.txt"
- When As "user1" edit the last created comment and set text to "My edited comment" it should return "404"
- Then As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- And the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- Scenario: Edit comments of other users should not be possible
- Given user "user0" exists
- Given user "user1" exists
- Given User "user0" uploads file "data/textfile.txt" to "/myFileToComment.txt"
- Given As "user0" sending "POST" to "/apps/files_sharing/api/v1/shares" with
- | path | myFileToComment.txt |
- | shareWith | user1 |
- | shareType | 0 |
- Given "user1" posts a comment with content "My first comment" on the file named "/myFileToComment.txt" it should return "201"
- When As "user0" load all the comments of the file named "/myFileToComment.txt" it should return "207"
- Then the response should contain a property "oc:parentId" with value "0"
- And the response should contain a property "oc:childrenCount" with value "0"
- And the response should contain a property "oc:verb" with value "comment"
- And the response should contain a property "oc:actorType" with value "users"
- And the response should contain a property "oc:objectType" with value "files"
- And the response should contain a property "oc:message" with value "My first comment"
- And the response should contain a property "oc:actorDisplayName" with value "user1"
- And the response should contain only "1" comments
- Then As "user0" edit the last created comment and set text to "My edited comment" it should return "403"
|