forked from Luracast/Restler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minmaxfix.feature
71 lines (62 loc) · 1.98 KB
/
minmaxfix.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
@param @min @max @fix
Feature: Minimum and Maximum with Fix
Scenario Outline: Int
When I request "/tests/param/minmaxfix/int/<number>"
Then the response status code should be 200
And the response is JSON
And the type is "int"
And the response equals <expected>
Examples:
| number | expected |
| 0 | 2 |
| 1 | 2 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 5 |
| 7 | 5 |
Scenario Outline: String
Given that I send {"string":<string>}
And the request is sent as JSON
When I request "/tests/param/minmaxfix/string"
Then the response status code should be 200
And the response is JSON
And the type is "string"
And the response equals <expected>
Examples:
| string | expected |
| "a" | "aa" |
| "ab" | "ab" |
| "abc" | "abc" |
| "abcd" | "abcd" |
| "abcde" | "abcde" |
| "abcdef" | "abcde" |
| "abcdefg" | "abcde" |
| "abcdefh" | "abcde" |
Scenario Outline: Array out of maximum range
Given that I send <array>
And the request is sent as JSON
When I request "/tests/param/minmaxfix/array"
Then the response status code should be 200
And the response is JSON
And the response equals <expected>
Examples:
| array | expected |
| [1,2] | [1,2] |
| [1,2,3] | [1,2,3] |
| [1,2,3,4] | [1,2,3,4] |
| [1,2,3,4,5] | [1,2,3,4,5] |
| [1,2,3,4,5,6] | [1,2,3,4,5] |
| [1,2,3,4,5,6,7] | [1,2,3,4,5] |
| [1,2,3,4,5,6,7,8] | [1,2,3,4,5] |
Scenario Outline: Array short of minimum is not expected
Given that I send <array>
And the request is sent as JSON
When I request "/tests/param/minmaxfix/array"
Then the response status code should be 400
And the response is JSON
Examples:
| array |
| [] |
| [1] |