Step Definitions & Transforms
[Collapse All]
Step Definitions
Given /^I am a rest client$/
Rubular
Then /^I receive the expected message$/
Rubular
Given /^I have a web service$/
Rubular
features/step_definitions/rest_client_steps.rb:3
3
4
5
6
7
8
Given(/^I have a web service$/) do
	@protocol = 'http'
	@server = FigNewton.server
	@port = FigNewton.port
  @mockservice = MockRestService.new(@server, @port, @protocol)
end
When /^I "(GET|DELETE)" from the web service$/
Rubular
features/step_definitions/rest_client_steps.rb:24
24
25
26
27
28
29
30
31
32
When(/^I "(GET|DELETE)" from the web service$/) do |type|
	case type.downcase
	when 'get'
		@response = @restbaby.get
	when 'delete'
		# @response = @restbaby.delete(@path)
		@response = @restbaby.delete
	end
end
Given /^I have "(GET|PUT|POST|DELETE)" service for "(.*?)"$/
Rubular
features/step_definitions/rest_client_steps.rb:10
10
11
12
13
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)"$/) do |type, path|
	@path = path
	@mockservice.store_msg(type, path, DEFAULT_MESSAGE)
end
And I have "PUT" service for "/test"
features/rest_client.feature:14
And I have "POST" service for "/test"
features/rest_client.feature:25
And I have "DELETE" service for "/test"
features/rest_client.feature:36
When /^I "(PUT|POST)" to the web service with the following$/
Rubular
features/step_definitions/rest_client_steps.rb:34
34
35
36
37
38
39
40
41
When(/^I "(PUT|POST)" to the web service with the following$/) do |type, message|
	case type.downcase
	when 'put'
		@response = @restbaby.put(message)
	when 'post'
		@response = @restbaby.post(message)
	end
end
Given /^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" as follows$/
Rubular
features/step_definitions/rest_client_steps.rb:15
15
16
17
18
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" as follows$/) do |type, path, message|
	@path = path
	@mockservice.store_msg(type, path, message)
end
And I have "GET" service for "/test" as follows
features/print_response.feature:6
And I have "PUT" service for "/test" as follows
features/print_response.feature:25
And I have "POST" service for "/test" as follows
features/print_response.feature:45
And I have "DELETE" service for "/test" as follows
features/print_response.feature:65
Then /^the response prints like the following$/
Rubular
features/step_definitions/rest_client_steps.rb:57
57
58
59
Then(/^the response prints like the following$/) do |response|
  expect(@restbaby.print_last_response).to eq(response)
end
Given /^I have basic auth for user "(.*?)" and password "(.*?)"$/
Rubular
features/step_definitions/header_steps.rb:17
17
18
19
Given(/^I have basic auth for user "(.*?)" and password "(.*?)"$/) do |user, password|
  @restbaby.set_auth(user, password)
end
And I have basic auth for user "test" and password "rest"
features/headers/header_options.feature:35 features/headers/header_options.feature:44
When /^I have the following headers?$/
Rubular
features/step_definitions/header_steps.rb:13
13
14
15
When(/^I have the following headers?$/) do |table|
	@restbaby.set_headers(table.rows_hash)
end
Given /^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" with the following headers$/
Rubular
features/step_definitions/header_steps.rb:8
8
9
10
11
Given(/^I have "(GET|PUT|POST|DELETE)" service for "(.*?)" with the following headers$/) do |type, path, table|
	@path = path
	@mockservice.store_msg(type, path, DEFAULT_MESSAGE, table.rows_hash)
end
And I have "GET" service for "/test" with the following headers
features/headers/header_options.feature:6
And I have "POST" service for "/test" with the following headers
features/headers/header_options.feature:17
Given /^I have a secure web service$/
Rubular
features/step_definitions/header_steps.rb:1
1
2
3
4
5
6
Given(/^I have a secure web service$/) do
	@protocol = 'https'
 	@server = FigNewton.server
	@port = FigNewton.port
  @mockservice = MockRestService.new(@server, @port, @protocol)
end
Given I have a secure web service
features/headers/header_options.feature:41
Then /^I receive the following$/
Rubular | UNUSED
features/step_definitions/rest_client_steps.rb:52
52
53
54
55
Then(/^I receive the following$/) do |message|
	expect(@response.code).to eq('200')
	expect(@response.body).to eq(message)
end
No steps were found to match this step definition.
When /^I pause$/
Rubular | UNUSED
features/step_definitions/rest_client_steps.rb:43
43
44
45
When(/^I pause$/) do
  pause()
end
No steps were found to match this step definition.
[Collapse All]
Step Transforms
Undefined Steps
No undefined steps