Commit 0860a9b7 by liyijie

Support formData

parent 89a8130e
......@@ -216,12 +216,14 @@ module RSpec
headers = builder.headers
env = builder.env
body = builder.body
form_data = builder.form_data
# Run the request
params = body || form_data
if ::Rails::VERSION::MAJOR >= 5
self.send(method, path, {params: body, headers: headers, env: env})
self.send(method, path, {params: params, headers: headers, env: env})
else
self.send(method, path, body, headers.merge(env))
self.send(method, path, params, headers.merge(env))
end
if example.metadata[:capture_examples]
......
......@@ -104,6 +104,10 @@ module RSpec
instance.send(key.split('&').last).to_json
end
end
def form_data
parameter_values('formData')
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment