From 9ce1c1e8252a87551b0b2f13013fafb9888b2abf Mon Sep 17 00:00:00 2001 From: Egor Raskhodchikov Date: Thu, 1 Feb 2018 14:05:49 +0700 Subject: [PATCH] Fix challenge server mapping --- features/runner_steps.rb | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/features/runner_steps.rb b/features/runner_steps.rb index d4dbcec..730c919 100644 --- a/features/runner_steps.rb +++ b/features/runner_steps.rb @@ -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