Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
our_own_cloud_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
1d4fcf95
Commit
1d4fcf95
authored
Mar 22, 2017
by
Sergio Bertolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified tests for using new code
parent
56099c57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
148 deletions
+35
-148
tests/integration/features/comments.feature
tests/integration/features/comments.feature
+35
-148
No files found.
tests/integration/features/comments.feature
View file @
1d4fcf95
...
...
@@ -43,162 +43,49 @@ Feature: Comments
Then
the HTTP status code should be
"204"
And
user
"user0"
should have 3 comments on file
"/myFileToComment.txt"
# 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"
And
user
"user1"
exists
And
As an
"user0"
And
User
"user0"
uploads file
"data/textfile.txt"
to
"/myFileToComment.txt"
And
file
"/myFileToComment.txt"
of user
"user0"
is shared with user
"user1"
And
user
"user0"
comments with content
"File owner comment"
on file
"/myFileToComment.txt"
And
user
"user1"
comments with content
"Sharee comment"
on file
"/myFileToComment.txt"
And
user
"user1"
should have the following comments on file
"/myFileToComment.txt"
|
user0
|
File
owner
comment
|
|
user1
|
Sharee
comment
|
When
user
"user1"
deletes the last created comment
Then
user
"user1"
should have 1 comments on file
"/myFileToComment.txt"
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"
And
User
"user0"
uploads file
"data/textfile.txt"
to
"/myFileToComment.txt"
And
user
"user0"
comments with content
"File owner comment"
on file
"/myFileToComment.txt"
When
user
"user0"
edits last comment with content
"My edited comment"
Then
the HTTP status code should be
"207"
And
user
"user0"
should have the following comments on file
"/myFileToComment.txt"
|
user0
|
My
edited
comment
|
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"
And
user
"user1"
exists
And
User
"user0"
uploads file
"data/textfile.txt"
to
"/myFileToComment.txt"
And
file
"/myFileToComment.txt"
of user
"user0"
is shared with user
"user1"
And
user
"user1"
comments with content
"Sharee comment"
on file
"/myFileToComment.txt"
When
user
"user1"
edits last comment with content
"My edited comment"
Then
the HTTP status code should be
"207"
And
user
"user1"
should have the following comments on file
"/myFileToComment.txt"
|
user1
|
My
edited
comment
|
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"
\ No newline at end of file
And
user
"user1"
exists
And
User
"user0"
uploads file
"data/textfile.txt"
to
"/myFileToComment.txt"
And
file
"/myFileToComment.txt"
of user
"user0"
is shared with user
"user1"
And
user
"user1"
comments with content
"Sharee comment"
on file
"/myFileToComment.txt"
And
user
"user0"
should have the following comments on file
"/myFileToComment.txt"
|
user1
|
Sharee
comment
|
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment