/
Depth.feature
49 lines (43 loc) · 2.44 KB
/
Depth.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@Repo @Depth
Feature: Depth
The Depth resource returns the depth of the repository from a specific commit and is supported through the "/repos/{repository}/repo/getdepth" endpoint
The command must be executed using the HTTP GET method
Scenario: Verify wrong HTTP method issues 405 "Method not allowed"
Given There is an empty repository named repo1
When I call "PUT /repos/repo1/repo/getdepth"
Then the response status should be '405'
And the response allowed methods should be "GET"
Scenario: Depth outside of a repository issues 404 "Not found"
Given There is an empty multirepo server
When I call "GET /repos/repo1/repo/getdepth"
Then the response status should be '404'
And the response ContentType should be "text/plain"
And the response body should contain "Repository not found"
Scenario: Depth with an invalid commit issues a 400 status code
Given There is a default multirepo server
When I call "GET /repos/repo1/repo/getdepth?commitId=invalid"
Then the response status should be '400'
And the response ContentType should be "text/plain"
And the response body should contain "You must specify a valid commit id."
Scenario: Depth with no commit returns no depth for a non-shallow repository
Given There is a default multirepo server
When I call "GET /repos/repo1/repo/getdepth"
Then the response status should be '200'
And the response ContentType should be "text/plain"
And the response body should contain ""
Scenario: Depth with no commit returns the depth of a shallow repository
Given There is a default multirepo server with a shallow clone
When I call "GET /repos/shallow/repo/getdepth"
Then the response status should be '200'
And the response ContentType should be "text/plain"
And the response body should contain "1"
Scenario: Depth with a commit returns the number of ancestors that commit has
Given There is a default multirepo server
When I call "GET /repos/repo1/repo/getdepth?commitId={@ObjectId|repo1|branch1}"
Then the response status should be '200'
And the response ContentType should be "text/plain"
And the response body should contain "1"
When I call "GET /repos/repo1/repo/getdepth?commitId={@ObjectId|repo1|master}"
Then the response status should be '200'
And the response ContentType should be "text/plain"
And the response body should contain "2"