-
Notifications
You must be signed in to change notification settings - Fork 26
/
checking_requests_were_made.feature
39 lines (35 loc) · 1.51 KB
/
checking_requests_were_made.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
Feature: Checking requests were made
In order to verify requests were made to mimic (like mock expectations)
As a developer
I want to be able to ask the Mimic API what requests were made
Scenario: Configuring a request and verifying it was called
Given that Mimic is running and accepting remote configuration on "/api"
When I make an HTTP POST request to "http://localhost:11988/api/get" with the payload:
"""
{"path": "/anything"}
"""
Then I should receive an HTTP 201 response with a body containing:
"""
{"stubs":["41f660b868e1308e8d87afbb84532b71"]}
"""
And I make an HTTP GET request to "http://localhost:11988/anything"
And I make an HTTP GET request to "http://localhost:11988/api/requests"
Then I should receive an HTTP 200 response with a body containing:
"""
{"requests":["41f660b868e1308e8d87afbb84532b71"]}
"""
Scenario: Configuring a request and verifying it was not called
Given that Mimic is running and accepting remote configuration on "/api"
When I make an HTTP POST request to "http://localhost:11988/api/get" with the payload:
"""
{"path": "/anything"}
"""
Then I should receive an HTTP 201 response with a body containing:
"""
{"stubs":["41f660b868e1308e8d87afbb84532b71"]}
"""
And I make an HTTP GET request to "http://localhost:11988/api/requests"
Then I should receive an HTTP 200 response with a body containing:
"""
{"requests":[]}
"""