Class: ExceptionHandling::Testing::ControllerStubBase

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_handling/testing.rb

Direct Known Subclasses

LoggingMethodsControllerStub

Defined Under Namespace

Classes: Request

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeControllerStubBase

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_methodObject

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

#requestObject

Returns the value of attribute request.



22
23
24
# File 'lib/exception_handling/testing.rb', line 22

def request
  @request
end

#sessionObject

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_nameObject



47
48
49
# File 'lib/exception_handling/testing.rb', line 47

def action_name
  "test_action"
end

#complete_request_uriObject



51
52
53
# File 'lib/exception_handling/testing.rb', line 51

def complete_request_uri
  "#{@request.protocol}#{@request.host}#{@request.request_uri}"
end