Module: Warden::Test::WardenHelpers
- Defined in:
- lib/warden/test/warden_helpers.rb
Instance Method Summary collapse
-
#_on_next_request ⇒ Object
private
A container for the on_next_request items.
-
#asset_paths ⇒ Object
Returns list of regex objects that match paths expected to be an asset.
-
#asset_paths=(*vals) ⇒ Object
Sets list of regex objects that match paths expected to be an asset.
-
#on_next_request(&blk) ⇒ Object
Adds a block to be executed on the next request when the stack reaches warden.
-
#test_reset! ⇒ Object
resets wardens tests any blocks queued to execute will be removed.
Instance Method Details
#_on_next_request ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A container for the on_next_request items.
38 39 40 41 |
# File 'lib/warden/test/warden_helpers.rb', line 38 def _on_next_request @_on_next_request ||= [] @_on_next_request end |
#asset_paths ⇒ Object
Returns list of regex objects that match paths expected to be an asset
11 12 13 |
# File 'lib/warden/test/warden_helpers.rb', line 11 def asset_paths @asset_paths ||= [/^\/assets\//] end |
#asset_paths=(*vals) ⇒ Object
Sets list of regex objects that match paths expected to be an asset
18 19 20 |
# File 'lib/warden/test/warden_helpers.rb', line 18 def asset_paths=(*vals) @asset_paths = vals end |
#on_next_request(&blk) ⇒ Object
Adds a block to be executed on the next request when the stack reaches warden. The warden proxy is yielded to the block
25 26 27 |
# File 'lib/warden/test/warden_helpers.rb', line 25 def on_next_request(&blk) _on_next_request << blk end |
#test_reset! ⇒ Object
resets wardens tests any blocks queued to execute will be removed
32 33 34 |
# File 'lib/warden/test/warden_helpers.rb', line 32 def test_reset! _on_next_request.clear end |