mirage-on-thin 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.simplecov +6 -0
- data/.travis.yml +3 -0
- data/Gemfile +29 -0
- data/Gemfile.lock +151 -0
- data/HISTORY +22 -0
- data/README.md +156 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/bin/mirage +14 -0
- data/features/.nav +29 -0
- data/features/client/clear.feature +78 -0
- data/features/client/configure.feature +72 -0
- data/features/client/model.feature +95 -0
- data/features/client/preview_responses.feature +33 -0
- data/features/client/prime.feature +32 -0
- data/features/client/put.feature +111 -0
- data/features/client/readme.md +3 -0
- data/features/client/requests.feature +20 -0
- data/features/client/running.feature +51 -0
- data/features/client/save_and_revert.feature +39 -0
- data/features/client/start.feature +46 -0
- data/features/client/stop.feature +53 -0
- data/features/commandline_interface/help.feature +17 -0
- data/features/commandline_interface/readme.md +1 -0
- data/features/commandline_interface/start.feature +18 -0
- data/features/commandline_interface/stop.feature +42 -0
- data/features/logging.feature +6 -0
- data/features/prime.feature +35 -0
- data/features/readme.md +7 -0
- data/features/requests/delete.feature +48 -0
- data/features/requests/get.feature +36 -0
- data/features/save_and_revert.feature +35 -0
- data/features/step_definitions/my_steps.rb +98 -0
- data/features/step_definitions/observation_steps.rb +103 -0
- data/features/support/command_line.rb +33 -0
- data/features/support/env.rb +22 -0
- data/features/support/hooks.rb +26 -0
- data/features/support/mirage.rb +12 -0
- data/features/support/web.rb +20 -0
- data/features/templates/delete.feature +45 -0
- data/features/templates/get.feature +54 -0
- data/features/templates/path_wildcards.feature +10 -0
- data/features/templates/preview.feature +18 -0
- data/features/templates/put.feature +77 -0
- data/features/templates/put_with_substitutions.feature +22 -0
- data/features/templates/readme.md +4 -0
- data/features/templates/required_content.feature +113 -0
- data/features/web_user_interface.feature +44 -0
- data/full_build.sh +100 -0
- data/lib/mirage/client.rb +10 -0
- data/lib/mirage/client/cli_bridge.rb +30 -0
- data/lib/mirage/client/client.rb +73 -0
- data/lib/mirage/client/error.rb +22 -0
- data/lib/mirage/client/helpers/method_builder.rb +19 -0
- data/lib/mirage/client/request.rb +26 -0
- data/lib/mirage/client/requests.rb +13 -0
- data/lib/mirage/client/runner.rb +103 -0
- data/lib/mirage/client/template.rb +56 -0
- data/lib/mirage/client/template/configuration.rb +44 -0
- data/lib/mirage/client/template/model.rb +48 -0
- data/lib/mirage/client/template/model/common_methods.rb +24 -0
- data/lib/mirage/client/template/model/instance_methods.rb +95 -0
- data/lib/mirage/client/templates.rb +50 -0
- data/mirage-on-thin.gemspec +175 -0
- data/mirage_server.rb +35 -0
- data/server/app.rb +4 -0
- data/server/binary_data_checker.rb +15 -0
- data/server/extensions/hash.rb +10 -0
- data/server/extensions/object.rb +5 -0
- data/server/helpers.rb +3 -0
- data/server/helpers/http_headers.rb +31 -0
- data/server/helpers/template_requirements.rb +33 -0
- data/server/mock_response.rb +242 -0
- data/server/server.rb +184 -0
- data/spec/client/cli_bridge_spec.rb +63 -0
- data/spec/client/client_spec.rb +179 -0
- data/spec/client/helpers/method_builder_spec.rb +40 -0
- data/spec/client/request_spec.rb +39 -0
- data/spec/client/requests_spec.rb +9 -0
- data/spec/client/runner_spec.rb +138 -0
- data/spec/client/template/configuration_spec.rb +32 -0
- data/spec/client/template/model/common_methods_spec.rb +25 -0
- data/spec/client/template/model/instance_methods_spec.rb +169 -0
- data/spec/client/template/model_spec.rb +119 -0
- data/spec/client/template_spec.rb +146 -0
- data/spec/client/templates_spec.rb +197 -0
- data/spec/resources/binary.file +0 -0
- data/spec/server/binary_data_checker_spec.rb +21 -0
- data/spec/server/helpers/http_headers_spec.rb +20 -0
- data/spec/server/helpers/template_requirements_spec.rb +34 -0
- data/spec/server/mock_response_spec.rb +577 -0
- data/spec/server/server_spec.rb +156 -0
- data/spec/spec_helper.rb +85 -0
- data/tasks/application.rake +7 -0
- data/tasks/packaging.rake +28 -0
- data/tasks/tests.rake +25 -0
- data/views/index.haml +16 -0
- data/views/response.haml +46 -0
- metadata +337 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Feature: Clearing Templates
|
|
2
|
+
|
|
3
|
+
The client can be used to clear responses and tracked request data from Mirage.
|
|
4
|
+
|
|
5
|
+
Like when calling Mirage's own interface directly, clearing a template also clears any associated request data
|
|
6
|
+
|
|
7
|
+
Background:
|
|
8
|
+
Given the following require statements are needed:
|
|
9
|
+
"""
|
|
10
|
+
require 'rubygems'
|
|
11
|
+
require 'mirage/client'
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
And a template for 'greeting' has been set with a value of 'Hello'
|
|
15
|
+
|
|
16
|
+
And I send GET to '/responses/greeting' with parameters:
|
|
17
|
+
| message | hello there |
|
|
18
|
+
And a template for 'leaving' has been set with a value of 'Goodbye'
|
|
19
|
+
|
|
20
|
+
And I send GET to '/responses/greeting' with parameters:
|
|
21
|
+
| message | I'm going |
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Scenario: Clearing a template
|
|
25
|
+
Given I run
|
|
26
|
+
"""
|
|
27
|
+
Mirage::Client.new.templates(1).delete
|
|
28
|
+
"""
|
|
29
|
+
When GET is sent to '/responses/greeting'
|
|
30
|
+
Then a 404 should be returned
|
|
31
|
+
When GET is sent to '/requests/1'
|
|
32
|
+
Then a 404 should be returned
|
|
33
|
+
|
|
34
|
+
When GET is sent to '/responses/leaving'
|
|
35
|
+
Then a 200 should be returned
|
|
36
|
+
When GET is sent to '/requests/2'
|
|
37
|
+
Then a 200 should be returned
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Scenario: Clearing a request
|
|
41
|
+
Given I run
|
|
42
|
+
"""
|
|
43
|
+
Mirage::Client.new.requests(1).delete
|
|
44
|
+
"""
|
|
45
|
+
When GET is sent to '/requests/1'
|
|
46
|
+
Then a 404 should be returned
|
|
47
|
+
When GET is sent to '/responses/greeting'
|
|
48
|
+
Then a 200 should be returned
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Scenario: Clearing everything
|
|
52
|
+
When I run
|
|
53
|
+
"""
|
|
54
|
+
Mirage::Client.new.templates.delete_all
|
|
55
|
+
"""
|
|
56
|
+
And GET is sent to '/responses/greeting'
|
|
57
|
+
Then a 404 should be returned
|
|
58
|
+
|
|
59
|
+
When GET is sent to '/requests/1'
|
|
60
|
+
Then a 404 should be returned
|
|
61
|
+
|
|
62
|
+
And GET is sent to '/responses/leaving'
|
|
63
|
+
Then a 404 should be returned
|
|
64
|
+
|
|
65
|
+
When GET is sent to '/requests/2'
|
|
66
|
+
Then a 404 should be returned
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
Scenario: Clearing all request data
|
|
70
|
+
When I run
|
|
71
|
+
"""
|
|
72
|
+
Mirage::Client.new.requests.delete_all
|
|
73
|
+
"""
|
|
74
|
+
When GET is sent to '/requests/1'
|
|
75
|
+
Then a 404 should be returned
|
|
76
|
+
|
|
77
|
+
When GET is sent to '/requests/2'
|
|
78
|
+
Then a 404 should be returned
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Feature: Configuring Templates
|
|
2
|
+
|
|
3
|
+
If you find yourself setting the same basic http settings for templates, the client can be configured to preset these.
|
|
4
|
+
|
|
5
|
+
Background:
|
|
6
|
+
Given the following require statements are needed:
|
|
7
|
+
"""
|
|
8
|
+
require 'rubygems'
|
|
9
|
+
require 'rspec/expectations'
|
|
10
|
+
require 'mirage/client'
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
Scenario: configuring the client on instance
|
|
14
|
+
Given I run
|
|
15
|
+
"""
|
|
16
|
+
client = Mirage::Client.new do
|
|
17
|
+
http_method :post
|
|
18
|
+
status 202
|
|
19
|
+
default true
|
|
20
|
+
delay 2
|
|
21
|
+
content_type "text/xml"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
client.put('greeting','hello')
|
|
25
|
+
"""
|
|
26
|
+
When POST is sent to '/responses/greeting/for/someone'
|
|
27
|
+
Then 'hello' should be returned
|
|
28
|
+
And a 202 should be returned
|
|
29
|
+
Then it should take at least '2' seconds
|
|
30
|
+
And the response 'content-type' should be 'text/xml'
|
|
31
|
+
|
|
32
|
+
Scenario: Configuring a client after it has been created
|
|
33
|
+
Given I run
|
|
34
|
+
"""
|
|
35
|
+
client = Mirage::Client.new
|
|
36
|
+
client.configure do
|
|
37
|
+
http_method :post
|
|
38
|
+
status 202
|
|
39
|
+
default false
|
|
40
|
+
delay 2
|
|
41
|
+
content_type "text/xml"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
client.put('greeting','hello')
|
|
45
|
+
"""
|
|
46
|
+
When POST is sent to '/responses/greeting'
|
|
47
|
+
Then 'hello' should be returned
|
|
48
|
+
And a 202 should be returned
|
|
49
|
+
Then it should take at least '2' seconds
|
|
50
|
+
And the response 'content-type' should be 'text/xml'
|
|
51
|
+
|
|
52
|
+
Scenario: resetting defaults
|
|
53
|
+
Given I run
|
|
54
|
+
"""
|
|
55
|
+
client = Mirage::Client.new
|
|
56
|
+
client.configure do
|
|
57
|
+
http_method :post
|
|
58
|
+
status 202
|
|
59
|
+
default true
|
|
60
|
+
delay 2
|
|
61
|
+
content_type "text/xml"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
client.reset
|
|
65
|
+
client.put('greeting','hello')
|
|
66
|
+
"""
|
|
67
|
+
When GET is sent to '/responses/greeting'
|
|
68
|
+
Then 'hello' should be returned
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Feature: Template Models
|
|
2
|
+
|
|
3
|
+
Use Models to for an object oriented approach to defining Templates.
|
|
4
|
+
|
|
5
|
+
The Mirage client provides the Mirage::Template::Model module that can be used to define your own model classes.
|
|
6
|
+
|
|
7
|
+
Having extended this module you must provide a 'body' method to customise the body of the response
|
|
8
|
+
|
|
9
|
+
The Model module provides class level methods for:
|
|
10
|
+
|
|
11
|
+
* Defaulting characteristics such as HTTP status code and Content-type
|
|
12
|
+
|
|
13
|
+
* Defining instance level methods that can set and get values.
|
|
14
|
+
|
|
15
|
+
Instances of classes that extend this module will also have all of the standard methods of a Mirage Template and hence you can also set your request requirements directly on them too.
|
|
16
|
+
|
|
17
|
+
Any defaults set using methods provided can be overridden after instances are created and when the client is used to add them as Templates to Mirage. See below for examples.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Background:
|
|
21
|
+
Given the following require statements are needed:
|
|
22
|
+
"""
|
|
23
|
+
require 'rubygems'
|
|
24
|
+
require 'mirage/client'
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
Scenario: Defining a Model
|
|
29
|
+
Given I run
|
|
30
|
+
"""
|
|
31
|
+
class UserProfile
|
|
32
|
+
extend Mirage::Template::Model
|
|
33
|
+
|
|
34
|
+
endpoint '/users'
|
|
35
|
+
http_method :get
|
|
36
|
+
status 202
|
|
37
|
+
content_type 'text/html'
|
|
38
|
+
|
|
39
|
+
def body
|
|
40
|
+
"Joe Blogs"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
Mirage::Client.new.put UserProfile.new
|
|
45
|
+
"""
|
|
46
|
+
When GET is sent to '/responses/users'
|
|
47
|
+
Then 'Joe Blogs' should be returned
|
|
48
|
+
And a 202 should be returned
|
|
49
|
+
And the content-type should be 'text/html'
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Scenario: Defining builder methods
|
|
53
|
+
Given I run
|
|
54
|
+
"""
|
|
55
|
+
class UserProfile
|
|
56
|
+
extend Mirage::Template::Model
|
|
57
|
+
endpoint '/users'
|
|
58
|
+
|
|
59
|
+
builder_methods :firstname, :surname
|
|
60
|
+
|
|
61
|
+
def body
|
|
62
|
+
"#{firstname} #{surname}"
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
Mirage::Client.new.put UserProfile.new.firstname('Joe').surname('Blogs')
|
|
67
|
+
"""
|
|
68
|
+
When GET is sent to '/responses/users'
|
|
69
|
+
Then 'Joe Blogs' should be returned
|
|
70
|
+
|
|
71
|
+
Scenario: Overriding model defaults
|
|
72
|
+
Given I run
|
|
73
|
+
"""
|
|
74
|
+
class UserProfile
|
|
75
|
+
extend Mirage::Template::Model
|
|
76
|
+
endpoint '/users'
|
|
77
|
+
|
|
78
|
+
builder_methods :firstname, :surname
|
|
79
|
+
status '200'
|
|
80
|
+
|
|
81
|
+
def body
|
|
82
|
+
"Joe Blogs"
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
Mirage::Client.new.put '/profiles', UserProfile.new do
|
|
87
|
+
status 202
|
|
88
|
+
end
|
|
89
|
+
"""
|
|
90
|
+
When GET is sent to '/responses/profiles'
|
|
91
|
+
Then 'Joe Blogs' should be returned
|
|
92
|
+
And a 202 should be returned
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Feature: Inspecting Templates
|
|
2
|
+
|
|
3
|
+
The client can be used to retrieve a template stored on Mirage.
|
|
4
|
+
|
|
5
|
+
Background:
|
|
6
|
+
Given the following require statements are needed:
|
|
7
|
+
"""
|
|
8
|
+
require 'rubygems'
|
|
9
|
+
require 'rspec/expectations'
|
|
10
|
+
require 'mirage/client'
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
Scenario: retrieving a Template
|
|
14
|
+
Given a template for 'greeting' has been set with a value of 'Hello'
|
|
15
|
+
|
|
16
|
+
When I run
|
|
17
|
+
"""
|
|
18
|
+
Mirage::Client.new.templates(1).body.should == 'Hello'
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
When GET is sent to '/requests/1'
|
|
22
|
+
Then a 404 should be returned
|
|
23
|
+
|
|
24
|
+
Scenario: retrieving a Template that does not exist
|
|
25
|
+
Given I run
|
|
26
|
+
"""
|
|
27
|
+
begin
|
|
28
|
+
Mirage::Client.new.templates(2).should == 'this should not have happened'
|
|
29
|
+
fail("Error should have been thrown")
|
|
30
|
+
rescue Exception => e
|
|
31
|
+
e.is_a?(Mirage::TemplateNotFound).should == true
|
|
32
|
+
end
|
|
33
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Feature: Priming Mirage
|
|
2
|
+
|
|
3
|
+
The client can be used to prime Mirage with Templates found in the templates directory that was configured when Mirage was started.
|
|
4
|
+
|
|
5
|
+
Background:
|
|
6
|
+
Given the following require statements are needed:
|
|
7
|
+
"""
|
|
8
|
+
require 'rubygems'
|
|
9
|
+
require 'rspec/expectations'
|
|
10
|
+
require 'mirage/client'
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
Scenario: Priming Mirage
|
|
14
|
+
Given Mirage is not running
|
|
15
|
+
And I run 'mirage start'
|
|
16
|
+
|
|
17
|
+
When the file 'mirage/default_greetings.rb' contains:
|
|
18
|
+
"""
|
|
19
|
+
prime do |mirage|
|
|
20
|
+
mirage.put('greeting', 'hello')
|
|
21
|
+
mirage.put('leaving', 'goodbye')
|
|
22
|
+
end
|
|
23
|
+
"""
|
|
24
|
+
And I run
|
|
25
|
+
"""
|
|
26
|
+
Mirage::Client.new.prime
|
|
27
|
+
"""
|
|
28
|
+
And GET is sent to '/responses/greeting'
|
|
29
|
+
Then 'hello' should be returned
|
|
30
|
+
|
|
31
|
+
When GET is sent to '/responses/leaving'
|
|
32
|
+
Then 'goodbye' should be returned
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Feature: Adding Templates
|
|
2
|
+
|
|
3
|
+
The Mirage client provides methods for setting Templates.
|
|
4
|
+
|
|
5
|
+
The client will escape all data for you so your free to just get on with using Mirage :)
|
|
6
|
+
|
|
7
|
+
Body, Header, and Parameter requirements can be specified as either a String or Regexp
|
|
8
|
+
|
|
9
|
+
Background:
|
|
10
|
+
Given the following require statements are needed:
|
|
11
|
+
"""
|
|
12
|
+
require 'rubygems'
|
|
13
|
+
require 'rspec/expectations'
|
|
14
|
+
require 'mirage/client'
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Scenario: Setting a Template on Mirage
|
|
19
|
+
Given I run
|
|
20
|
+
"""
|
|
21
|
+
Mirage::Client.new.put('greeting','hello')
|
|
22
|
+
"""
|
|
23
|
+
When GET is sent to '/responses/greeting'
|
|
24
|
+
Then 'hello' should be returned
|
|
25
|
+
|
|
26
|
+
Scenario: Setting the required HTTP method
|
|
27
|
+
Given I run
|
|
28
|
+
"""
|
|
29
|
+
Mirage::Client.new.put('greeting', 'Hello Leon') do
|
|
30
|
+
http_method 'POST'
|
|
31
|
+
end
|
|
32
|
+
"""
|
|
33
|
+
When GET is sent to '/responses/greeting'
|
|
34
|
+
Then a 404 should be returned
|
|
35
|
+
When POST is sent to '/responses/greeting'
|
|
36
|
+
Then 'Hello Leon' should be returned
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Scenario: Setting a requirement on body content
|
|
40
|
+
Given I run
|
|
41
|
+
"""
|
|
42
|
+
Mirage::Client.new.put('greeting', 'Hello Leon') do
|
|
43
|
+
http_method 'POST'
|
|
44
|
+
required_body_content << /leon/
|
|
45
|
+
end
|
|
46
|
+
"""
|
|
47
|
+
When POST is sent to '/responses/greeting'
|
|
48
|
+
Then a 404 should be returned
|
|
49
|
+
When I send POST to '/responses/greeting' with request entity
|
|
50
|
+
"""
|
|
51
|
+
<greetingRequest>
|
|
52
|
+
<name>leon</name>
|
|
53
|
+
</greetingRequest>
|
|
54
|
+
"""
|
|
55
|
+
Then 'Hello Leon' should be returned
|
|
56
|
+
|
|
57
|
+
Scenario: Setting a requirement on requests parameters
|
|
58
|
+
Given I run
|
|
59
|
+
"""
|
|
60
|
+
Mirage::Client.new.put('greeting', 'Hello Leon') do
|
|
61
|
+
http_method 'POST'
|
|
62
|
+
required_parameters[:name] = /leon/
|
|
63
|
+
end
|
|
64
|
+
"""
|
|
65
|
+
When POST is sent to '/responses/greeting'
|
|
66
|
+
Then a 404 should be returned
|
|
67
|
+
When I send POST to '/responses/greeting' with parameters:
|
|
68
|
+
| name | leon |
|
|
69
|
+
|
|
70
|
+
Then 'Hello Leon' should be returned
|
|
71
|
+
|
|
72
|
+
Scenario: setting a response as default
|
|
73
|
+
Given I run
|
|
74
|
+
"""
|
|
75
|
+
Mirage.start.clear
|
|
76
|
+
|
|
77
|
+
Mirage::Client.new.put('greeting', 'default greeting') do
|
|
78
|
+
default true
|
|
79
|
+
end
|
|
80
|
+
"""
|
|
81
|
+
When GET is sent to '/responses/greeting/for/joel'
|
|
82
|
+
Then 'default greeting' should be returned
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
Scenario: Setting the content type
|
|
86
|
+
Given I run
|
|
87
|
+
"""
|
|
88
|
+
Mirage::Client.new.put('greeting', '<xml></xml>') do
|
|
89
|
+
content_type 'text/xml'
|
|
90
|
+
end
|
|
91
|
+
"""
|
|
92
|
+
When GET is sent to '/responses/greeting'
|
|
93
|
+
And the response 'content-type' should be 'text/xml'
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
Scenario: Setting the HTTP status code
|
|
97
|
+
Given I run
|
|
98
|
+
"""
|
|
99
|
+
Mirage::Client.new.put('greeting', 'hello'){status 203}
|
|
100
|
+
"""
|
|
101
|
+
When GET is sent to '/responses/greeting'
|
|
102
|
+
Then a 203 should be returned
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
Scenario: Setting a delay
|
|
106
|
+
Given I run
|
|
107
|
+
"""
|
|
108
|
+
Mirage::Client.new.put('greeting', 'hello'){delay 2}
|
|
109
|
+
"""
|
|
110
|
+
When GET is sent to '/responses/greeting'
|
|
111
|
+
Then it should take at least '2' seconds
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Feature: Retrieving tracked requests
|
|
2
|
+
|
|
3
|
+
Requests made to the Mirage Server can be retrieved using the Mirage client
|
|
4
|
+
|
|
5
|
+
Background:
|
|
6
|
+
Given the following require statements are needed:
|
|
7
|
+
"""
|
|
8
|
+
require 'rubygems'
|
|
9
|
+
require 'mirage/client'
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
Scenario: Retrieving request data
|
|
13
|
+
Given a template for 'greeting' has been set with a value of 'Hello'
|
|
14
|
+
|
|
15
|
+
When I send GET to '/responses/greeting' with parameters:
|
|
16
|
+
| name | leon |
|
|
17
|
+
Then I run
|
|
18
|
+
"""
|
|
19
|
+
Mirage::Client.new.requests(1).parameters.should == {'name' => 'leon'}
|
|
20
|
+
"""
|