lib/serial_spec/request_response.rb in serial-spec-0.1.1 vs lib/serial_spec/request_response.rb in serial-spec-0.2.0
- old
+ new
@@ -1,13 +1,15 @@
require "rack/test"
require "inheritable_accessors/inheritable_hash_accessor"
+require "serial_spec/request_response/helpers"
module SerialSpec
module RequestResponse
extend ActiveSupport::Concern
include Rack::Test::Methods
include InheritableAccessors::InheritableHashAccessor
+ include Helpers
included do
include ::SerialSpec::RequestResponse::DSL
extend ::SerialSpec::RequestResponse::DSL
@@ -41,33 +43,9 @@
request_opts[:method] = new_method
else
methud = request_opts[:method]
return methud if methud
raise "You must configure a request method"
- end
- end
-
-
- end
-
- module Helpers
- extend ActiveSupport::Concern
-
- def status
- response.status
- end
-
- def headers
- response.headers
- end
-
- def response
- last_response
- end
-
- def body
- @body ||= begin
- JSON.parse(response.body)
end
end
end
\ No newline at end of file