Sha256: ddc9f1116c0638abb276483fb5406ed7a785427cc2eb80b264f7ef06f26e4448

Contents?: true

Size: 835 Bytes

Versions: 39

Compression:

Stored size: 835 Bytes

Contents

# frozen_string_literal: true

module ControllerLevelHelpers
  # This provides some common mock methods for view tests.
  # These are normally provided by the controller.
  module ControllerViewHelpers
    def search_state
      @search_state ||= CatalogController.search_state_class.new(params, blacklight_config, controller)
    end

    # This allows you to set the configuration
    # @example: view.blacklight_config = Blacklight::Configuration.new
    attr_writer :blacklight_config

    def blacklight_config
      @blacklight_config ||= CatalogController.blacklight_config
    end

    def blacklight_configuration_context
      @blacklight_configuration_context ||= Blacklight::Configuration::Context.new(controller)
    end
  end

  def initialize_controller_helpers(helper)
    helper.extend ControllerViewHelpers
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
hyrax-5.0.0 spec/support/controller_level_helpers.rb
hyrax-5.0.0.rc3 spec/support/controller_level_helpers.rb
hyrax-2.6.0 spec/support/controller_level_helpers.rb
hyrax-3.0.0.pre.rc1 spec/support/controller_level_helpers.rb
hyrax-3.0.0.pre.beta3 spec/support/controller_level_helpers.rb
hyrax-2.5.1 spec/support/controller_level_helpers.rb
hyrax-2.5.0 spec/support/controller_level_helpers.rb
hyrax-3.0.0.pre.beta2 spec/support/controller_level_helpers.rb
hyrax-2.4.1 spec/support/controller_level_helpers.rb
hyrax-3.0.0.pre.beta1 spec/support/controller_level_helpers.rb
hyrax-2.4.0 spec/support/controller_level_helpers.rb
hyrax-2.3.3 spec/support/controller_level_helpers.rb
hyrax-2.3.2 spec/support/controller_level_helpers.rb
hyrax-2.3.1 spec/support/controller_level_helpers.rb
hyrax-2.3.0 spec/support/controller_level_helpers.rb
hyrax-2.0.3 spec/support/controller_level_helpers.rb
hyrax-2.2.4 spec/support/controller_level_helpers.rb
hyrax-2.2.3 spec/support/controller_level_helpers.rb
hyrax-2.2.2 spec/support/controller_level_helpers.rb
hyrax-2.2.1 spec/support/controller_level_helpers.rb