Module: RSpec::Hanami::RequestHelpers
- Defined in:
- lib/rspec/hanami/request_helpers.rb
Defined Under Namespace
Classes: Request
Class Method Summary collapse
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
- #patch(path, options = {}) ⇒ Object
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
- #request(request) ⇒ Object
Class Method Details
.included(klass) ⇒ Object
43 44 45 46 47 |
# File 'lib/rspec/hanami/request_helpers.rb', line 43 def self.included(klass) klass.class_eval do attr_reader :response end end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
69 70 71 |
# File 'lib/rspec/hanami/request_helpers.rb', line 69 def delete(path, = {}) request(Request.new('DELETE', path, )) end |
#get(path, options = {}) ⇒ Object
53 54 55 |
# File 'lib/rspec/hanami/request_helpers.rb', line 53 def get(path, = {}) request(Request.new('GET', path, )) end |
#patch(path, options = {}) ⇒ Object
61 62 63 |
# File 'lib/rspec/hanami/request_helpers.rb', line 61 def patch(path, = {}) request(Request.new('PATCH', path, )) end |
#post(path, options = {}) ⇒ Object
57 58 59 |
# File 'lib/rspec/hanami/request_helpers.rb', line 57 def post(path, = {}) request(Request.new('POST', path, )) end |
#put(path, options = {}) ⇒ Object
65 66 67 |
# File 'lib/rspec/hanami/request_helpers.rb', line 65 def put(path, = {}) request(Request.new('PUT', path, )) end |
#request(request) ⇒ Object
49 50 51 |
# File 'lib/rspec/hanami/request_helpers.rb', line 49 def request(request) @response = ::Hanami.app.call(request.env) end |