Sha256: c50c221ac9a28af707a2dbdb98837f17256a5223d49a0bfcd8033b953a606cb9

Contents?: true

Size: 690 Bytes

Versions: 15

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

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

  let(:controller) { (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

15 entries across 15 versions & 1 rubygems

Version Path
blacklight-7.33.1 spec/controllers/blacklight/base_spec.rb
blacklight-7.33.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.32.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.31.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.30.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.29.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.28.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.27.1 spec/controllers/blacklight/base_spec.rb
blacklight-7.27.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.26.1 spec/controllers/blacklight/base_spec.rb
blacklight-7.26.0 spec/controllers/blacklight/base_spec.rb
blacklight-7.25.3 spec/controllers/blacklight/base_spec.rb
blacklight-7.25.2 spec/controllers/blacklight/base_spec.rb
blacklight-7.25.1 spec/controllers/blacklight/base_spec.rb
blacklight-7.25.0 spec/controllers/blacklight/base_spec.rb