Module: Warden::Test::WardenHelpers
- Defined in:
- lib/warden/test/warden_helpers.rb
Instance Method Summary collapse
-
#_on_next_request ⇒ Object
private
A containter 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 containter for the on_next_request items.
37 38 39 40 |
# File 'lib/warden/test/warden_helpers.rb', line 37 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
10 11 12 |
# File 'lib/warden/test/warden_helpers.rb', line 10 def asset_paths @asset_paths ||= [/^\/assets\//] end |
#asset_paths=(*vals) ⇒ Object
Sets list of regex objects that match paths expected to be an asset
17 18 19 |
# File 'lib/warden/test/warden_helpers.rb', line 17 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
24 25 26 |
# File 'lib/warden/test/warden_helpers.rb', line 24 def on_next_request(&blk) _on_next_request << blk end |
#test_reset! ⇒ Object
resets wardens tests any blocks queued to execute will be removed
31 32 33 |
# File 'lib/warden/test/warden_helpers.rb', line 31 def test_reset! _on_next_request.clear end |