Module: SharkOnLambda::RSpec::Helpers

Included in:
JsonapiHelpers
Defined in:
lib/shark_on_lambda/rspec/helpers.rb

Instance Method Summary collapse

Instance Method Details

#delete(controller_method, options = {}) ⇒ Object



6
7
8
# File 'lib/shark_on_lambda/rspec/helpers.rb', line 6

def delete(controller_method, options = {})
  make_request('DELETE', controller_method, options)
end

#get(controller_method, options = {}) ⇒ Object



10
11
12
# File 'lib/shark_on_lambda/rspec/helpers.rb', line 10

def get(controller_method, options = {})
  make_request('GET', controller_method, options)
end

#patch(controller_method, options = {}) ⇒ Object



14
15
16
# File 'lib/shark_on_lambda/rspec/helpers.rb', line 14

def patch(controller_method, options = {})
  make_request('PATCH', controller_method, options)
end

#post(controller_method, options = {}) ⇒ Object



18
19
20
# File 'lib/shark_on_lambda/rspec/helpers.rb', line 18

def post(controller_method, options = {})
  make_request('POST', controller_method, options)
end

#put(controller_method, options = {}) ⇒ Object



22
23
24
# File 'lib/shark_on_lambda/rspec/helpers.rb', line 22

def put(controller_method, options = {})
  make_request('PUT', controller_method, options)
end

#responseObject



26
27
28
29
30
31
32
# File 'lib/shark_on_lambda/rspec/helpers.rb', line 26

def response
  if @response.nil?
    raise 'You must make a request before you can request a response.'
  end

  @response
end