Class: GraphqlRails::RSpecControllerHelpers::Request

Inherits:
Controller::Request show all
Defined in:
lib/graphql_rails/rspec_controller_helpers.rb

Overview

controller request object more suitable for testing

Instance Attribute Summary collapse

Attributes inherited from Controller::Request

#context, #errors, #lookahead, #object_to_return

Instance Method Summary collapse

Methods inherited from Controller::Request

#no_object_to_return?, #params

Constructor Details

#initialize(params, context, controller: nil, action_name: nil) ⇒ Request

Returns a new instance of Request.



107
108
109
110
111
112
113
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 107

def initialize(params, context, controller: nil, action_name: nil)
  inputs = params || {}
  inputs = inputs.merge(lookahead: ::GraphQL::Execution::Lookahead::NullLookahead.new)
  @controller = controller
  @action_name = action_name
  super(nil, inputs, context)
end

Instance Attribute Details

#action_nameObject (readonly)

Returns the value of attribute action_name.



105
106
107
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 105

def action_name
  @action_name
end

#controllerObject (readonly)

Returns the value of attribute controller.



105
106
107
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 105

def controller
  @controller
end