Sha256: d39c7c2fff240ca5a05f728299d94349f8fed0799f73cf9ce87219060523e2f0

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8
# frozen_string_literal: true

module Warden

  module Test
    module WardenHelpers
      # Returns list of regex objects that match paths expected to be an asset
      # @see Warden::Proxy#asset_request?
      # @api public
      def asset_paths
        @asset_paths ||= [/^\/assets\//]
      end

      # Sets list of regex objects that match paths expected to be an asset
      # @see Warden::Proxy#asset_request?
      # @api public
      def asset_paths=(*vals)
        @asset_paths = vals
      end

      # Adds a block to be executed on the next request when the stack reaches warden.
      # The warden proxy is yielded to the block
      # @api public
      def on_next_request(&blk)
        _on_next_request << blk
      end

      # resets wardens tests
      # any blocks queued to execute will be removed
      # @api public
      def test_reset!
        _on_next_request.clear
      end

      # A container for the on_next_request items.
      # @api private
      def _on_next_request
        @_on_next_request ||= []
        @_on_next_request
      end
    end
  end
end

Version data entries

7 entries across 6 versions & 4 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/warden-1.2.9/lib/warden/test/warden_helpers.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/warden-1.2.9/lib/warden/test/warden_helpers.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/warden-1.2.9/lib/warden/test/warden_helpers.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/warden-1.2.9/lib/warden/test/warden_helpers.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/warden-1.2.9/lib/warden/test/warden_helpers.rb
warden-1.2.9 lib/warden/test/warden_helpers.rb
warden-1.2.8 lib/warden/test/warden_helpers.rb