-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtop.feature
51 lines (47 loc) · 1.54 KB
/
top.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
50
Feature: Top endpoint
As a user I want to retrieve all the top github contributors
Scenario: Default values
Given a server
And having these contributors "gthreepwood,bbernoulli"
When I "GET" request to "/top?location='barcelona'"
Then response is successful
And response is JSON
And response data should match JSON list:
"""
[
{
"username":"gthreepwood",
"vcs":"github",
"profile_url":"https://github.com/gthreepwood",
"avatar_url":"http://foo.bar"
},
{
"username":"bbernoulli",
"vcs":"github",
"profile_url":"https://github.com/bbernoulli",
"avatar_url":"http://foo.bar"
}
]
"""
Scenario: Limiting results
Given a server
And having these contributors "gthreepwood,bbernoulli"
When I "GET" request to "/top?location='barcelona'&limit=1"
Then response is successful
And response is JSON
And response data should match JSON list:
"""
[
{
"username":"gthreepwood",
"vcs":"github",
"profile_url":"https://github.com/gthreepwood",
"avatar_url":"http://foo.bar"
}
]
"""
Scenario: Erroring because missing location
Given a server
And having these contributors "gthreepwood,bbernoulli"
When I "GET" request to "/top"
Then response is error 400