Class: ExceptionHandling::Testing::ControllerStub
- Inherits:
-
Object
- Object
- ExceptionHandling::Testing::ControllerStub
- Includes:
- Methods
- Defined in:
- lib/exception_handling/testing.rb
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
- #controller_name ⇒ Object
-
#initialize ⇒ ControllerStub
constructor
A new instance of ControllerStub.
- #simulate_around_filter(&block) ⇒ Object
Constructor Details
#initialize ⇒ ControllerStub
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/exception_handling/testing.rb', line 25 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.
22 23 24 |
# File 'lib/exception_handling/testing.rb', line 22 def around_filter_method @around_filter_method end |
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
20 21 22 |
# File 'lib/exception_handling/testing.rb', line 20 def request @request end |
#session ⇒ Object
Returns the value of attribute session.
20 21 22 |
# File 'lib/exception_handling/testing.rb', line 20 def session @session end |
Class Method Details
.around_filter(method) ⇒ Object
52 53 54 |
# File 'lib/exception_handling/testing.rb', line 52 def self.around_filter( method ) ControllerStub.around_filter_method = method end |
Instance Method Details
#action_name ⇒ Object
48 49 50 |
# File 'lib/exception_handling/testing.rb', line 48 def action_name "test_action" end |
#complete_request_uri ⇒ Object
56 57 58 |
# File 'lib/exception_handling/testing.rb', line 56 def complete_request_uri "#{@request.protocol}#{@request.host}#{@request.request_uri}" end |
#controller_name ⇒ Object
44 45 46 |
# File 'lib/exception_handling/testing.rb', line 44 def controller_name "ControllerStub" end |
#simulate_around_filter(&block) ⇒ Object
40 41 42 |
# File 'lib/exception_handling/testing.rb', line 40 def simulate_around_filter( &block ) set_current_controller( &block ) end |