features/get_request.feature in restful_mapper-0.0.2 vs features/get_request.feature in restful_mapper-0.0.3

- old
+ new

@@ -1,24 +1,24 @@ Feature: get request Scenario: simple get request without any parameters that returns 200 Given following service definition - """ + """ class SimpleService < RestfulMapper::Service base_url "http://localhost:8765" get :simple_endpoint do path "/simple" - + responses 200 => {String => String} end end """ And the service endpoint at port 8765 responds with following http response: """ - HTTP/1.1 200 OK + HTTP/1.1 200 OK Connection: close Content-Type: application/json {"a": "b"} """ @@ -26,48 +26,49 @@ Then the result should be equal to: """ {"a" => "b"} """ - Scenario: simple get request without any parameters that returns 302 - Given following service definition - """ - class SimpleService < RestfulMapper::Service - base_url "http://localhost:8765" +# @wip +# Scenario: simple get request without any parameters that returns 302 +# Given following service definition +# """ +# class SimpleService < RestfulMapper::Service +# base_url "http://localhost:8765" - get :simple_endpoint do - path "/simple" - - responses 302 => true - end +# get :simple_endpoint do +# path "/simple" - end - """ - And the service endpoint at port 8765 responds with following http response: - """ - HTTP/1.1 302 OK - Connection: close - Content-Type: application/json +# responses 302 => true +# end - """ - When I call service "SimpleService.simple_endpoint" - Then the result should be equal to: - """ - true - """ +# end +# """ +# And the service endpoint at port 8765 responds with following http response: +# """ +# HTTP/1.1 302 OK +# Connection: close +# Content-Type: application/json +# """ +# When I call service "SimpleService.simple_endpoint" +# Then the result should be equal to: +# """ +# true +# """ + Scenario: simple get request with request parameters Given following service definition """ class SimpleService < RestfulMapper::Service base_url "http://localhost:8765" get :simple_endpoint do path "/simple" query_parameters [:name] - + responses 302 => true end end """ @@ -85,40 +86,40 @@ class SimpleService < RestfulMapper::Service base_url "http://localhost:8765" get :simple_endpoint do path "/simple/{{name}}" - + responses 302 => true end end """ And the service endpoint at port 8765 is running When I call service "SimpleService.simple_endpoint name: 'test'" Then the endpoint should receive request """ GET /simple/test HTTP/1.1 - + """ Scenario: simple get request with path and query parameters Given following service definition """ class SimpleService < RestfulMapper::Service base_url "http://localhost:8765" get :simple_endpoint do path "/simple/{{name}}" - query_parameters [:name] + query_parameters [:name] responses 302 => true end end """ And the service endpoint at port 8765 is running When I call service "SimpleService.simple_endpoint name: 'test'" Then the endpoint should receive request """ GET /simple/test?name=test HTTP/1.1 - + """