forked from Luracast/Restler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminmax.feature
72 lines (61 loc) · 1.93 KB
/
minmax.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@param @min @max
Feature: Minimum and Maximum
Scenario Outline: Int
When I request "/tests/param/minmax/int/<number>"
Then the response status code should be 200
And the response is JSON
And the type is "int"
And the value equals <number>
Examples:
| number |
| 2 |
| 3 |
| 4 |
| 5 |
Scenario: Int lower than the minimum
When I request "/tests/param/minmax/int/1"
Then the response status code should be 400
And the response is JSON
Scenario: Int higher than maximum
When I request "/tests/param/minmax/int/6"
Then the response status code should be 400
And the response is JSON
Scenario: String
When I request "/tests/param/minmax/string/me"
Then the response status code should be 200
And the response is JSON
And the type is "string"
And the value equals "me"
Scenario: Short String
When I request "/tests/param/minmax/string/i"
Then the response status code should be 400
And the response is JSON
Scenario: Lengthy String
When I request "/tests/param/minmax/string/arulkumaran"
Then the response status code should be 400
And the response is JSON
Scenario Outline: Array
Given that I send <data>
And the request is sent as JSON
When I request "/tests/param/minmax/array"
Then the response status code should be 200
And the response is JSON
Examples:
| data |
| [1,2] |
| [1,2,3] |
| [1,2,3,4] |
| [1,2,3,4,5] |
Scenario Outline: Array out of range
Given that I send <data>
And the request is sent as JSON
When I request "/tests/param/minmax/array"
Then the response status code should be 400
And the response is JSON
Examples:
| data |
| [] |
| [1] |
| [1,2,3,4,5,6] |
| [1,2,3,4,5,6,7] |
| [1,2,3,4,5,6,7,8] |