Class: GraphqlRails::RSpecControllerHelpers::Response
- Inherits:
-
Object
- Object
- GraphqlRails::RSpecControllerHelpers::Response
- Defined in:
- lib/graphql_rails/rspec_controller_helpers.rb
Overview
contains all details about testing response. Similar as in rspec controllers tests
Instance Method Summary collapse
- #action_name ⇒ Object
- #controller ⇒ Object
- #errors ⇒ Object
- #failure? ⇒ Boolean
-
#initialize(request) ⇒ Response
constructor
A new instance of Response.
- #result ⇒ Object
- #success? ⇒ Boolean
- #successful? ⇒ Boolean
Constructor Details
#initialize(request) ⇒ Response
Returns a new instance of Response.
25 26 27 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 25 def initialize(request) @request = request end |
Instance Method Details
#action_name ⇒ Object
53 54 55 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 53 def action_name request.action_name end |
#controller ⇒ Object
49 50 51 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 49 def controller request.controller end |
#errors ⇒ Object
33 34 35 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 33 def errors request.errors end |
#failure? ⇒ Boolean
45 46 47 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 45 def failure? !success? end |
#result ⇒ Object
29 30 31 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 29 def result request.object_to_return end |
#success? ⇒ Boolean
37 38 39 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 37 def success? request.errors.empty? end |
#successful? ⇒ Boolean
41 42 43 |
# File 'lib/graphql_rails/rspec_controller_helpers.rb', line 41 def successful? success? end |