Module: Warden::Test::WardenHelpers

Defined in:
lib/warden/test/warden_helpers.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) _on_next_request

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

- (Object) asset_paths

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

- (Object) asset_paths=(*vals)

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

- (Object) on_next_request(&blk)

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

- (Object) test_reset!

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