Skip to content

Commit

Permalink
Fix challenge server mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
egorras committed Feb 1, 2018
1 parent 462b63e commit 9ce1c1e
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions features/runner_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,21 @@
end
end

Given(/^the challenge server returns (\\d+) for all requests$/) do |return_code|
config = ServerConfig.new

config.endpoint_matches = "^(.*)"
config.status = return_code
config.verb = "ANY"

@challenge_server_stub.create_new_mapping(config)
end

Given(/^the challenge server returns (\\d+), response body "([^\"]*)" for all requests$/) do |return_code, body|
config = ServerConfig.new

config.endpoint_matches = "^(.*)"
config.status = return_code
config.verb = "ANY"
config.response_body = body

@challenge_server_stub.create_new_mapping(config)
Given(/^the challenge server returns (\d+) for all requests$/) do |return_code|
@challenge_server_stub.create_new_mapping({
endpointMatches: '^(.*)',
status: return_code,
verb: 'ANY'
})
end

Given(/^the challenge server returns (\d+), response body "([^"]*)" for all requests$/) do |return_code, body|
@challenge_server_stub.create_new_mapping({
endpointMatches: '^(.*)',
status: return_code,
verb: 'ANY',
responseBody: body
})
end

Given(/^the challenges folder is empty$/) do
Expand Down

0 comments on commit 9ce1c1e

Please sign in to comment.