Module: WebPipe::TestSupport
- Defined in:
- lib/web_pipe/test_support.rb
Overview
Test helper methods.
This module is meant to be included in a test file to provide helper methods.
Instance Method Summary collapse
Instance Method Details
#build_conn(uri = '', attributes: {}, env_opts: {}) ⇒ Conn
Builds a Conn
attributes
struct. It overrides what is taken from the uri
parameter
connection struct is created. See Rack::MockRequest.env_for.
21 22 23 24 25 26 |
# File 'lib/web_pipe/test_support.rb', line 21 def build_conn(uri = '', attributes: {}, env_opts: {}) env = Rack::MockRequest.env_for(uri, env_opts) ConnSupport::Builder .call(env) .new(attributes) end |