Class: ExceptionHandling::Testing::ControllerStubBase
- Inherits:
-
Object
- Object
- ExceptionHandling::Testing::ControllerStubBase
- Defined in:
- lib/exception_handling/testing.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Request
Class Attribute Summary collapse
-
.around_filter_method ⇒ Object
Returns the value of attribute around_filter_method.
Instance Attribute Summary collapse
-
#request ⇒ Object
Returns the value of attribute request.
-
#session ⇒ Object
Returns the value of attribute session.
Class Method Summary collapse
Instance Method Summary collapse
- #action_name ⇒ Object
- #complete_request_uri ⇒ Object
-
#initialize ⇒ ControllerStubBase
constructor
A new instance of ControllerStubBase.
Constructor Details
#initialize ⇒ ControllerStubBase
Returns a new instance of ControllerStubBase.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/exception_handling/testing.rb', line 32 def initialize @request = Request.new @session_id = "ZKL95" @session = if defined?(Username) { login_count: 22, username_id: Username.first.id, user_id: User.first.id, } else {} end end |
Class Attribute Details
.around_filter_method ⇒ Object
Returns the value of attribute around_filter_method.
25 26 27 |
# File 'lib/exception_handling/testing.rb', line 25 def around_filter_method @around_filter_method end |
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
22 23 24 |
# File 'lib/exception_handling/testing.rb', line 22 def request @request end |
#session ⇒ Object
Returns the value of attribute session.
22 23 24 |
# File 'lib/exception_handling/testing.rb', line 22 def session @session end |
Class Method Details
.around_filter(method) ⇒ Object
27 28 29 |
# File 'lib/exception_handling/testing.rb', line 27 def around_filter(method) self.around_filter_method = method end |
Instance Method Details
#action_name ⇒ Object
47 48 49 |
# File 'lib/exception_handling/testing.rb', line 47 def action_name "test_action" end |
#complete_request_uri ⇒ Object
51 52 53 |
# File 'lib/exception_handling/testing.rb', line 51 def complete_request_uri "#{@request.protocol}#{@request.host}#{@request.request_uri}" end |