Sha256: ab796141781f32d8da1804f98b511449dd7f2d7258f63e7f293331f6eb921965

Contents?: true

Size: 731 Bytes

Versions: 10

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::Base do
  subject { controller }

  let(:controller) { Deprecation.silence(described_class) { (Class.new(ApplicationController) { include Blacklight::Base }).new } }

  describe "#search_state" do
    subject { controller.send(:search_state) }

    let(:raw_params) { HashWithIndifferentAccess.new a: 1 }
    let(:params) { ActionController::Parameters.new raw_params }

    before do
      controller.blacklight_config.search_state_fields << :a
      allow(controller).to receive_messages(params: params)
    end

    it "creates a path object" do
      expect(subject).to be_kind_of Blacklight::SearchState
      expect(subject.params).to eq raw_params
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.39.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.38.0 spec/controllers/blacklight/base_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/controllers/blacklight/base_spec.rb
blacklight-7.37.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.36.2 spec/controllers/blacklight/base_spec.rb
blacklight-7.36.1 spec/controllers/blacklight/base_spec.rb
blacklight-7.36.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.35.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.34.0 spec/controllers/blacklight/base_spec.rb