Sha256: 56442db525cbb99e1a42259fb5f8f9542f8f29364629443164ae37de8c391513
Contents?: true
Size: 933 Bytes
Versions: 49
Compression:
Stored size: 933 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe Blacklight::StartOverButtonComponent, type: :component do subject(:render) { render_inline(instance) } let(:instance) { described_class.new } let(:blacklight_config) do Blacklight::Configuration.new.configure do |config| config.view = { list: nil, abc: nil } end end before do allow(controller).to receive(:blacklight_config).and_return(blacklight_config) end context 'with the current view type' do before do controller.params[:view] = 'abc' end it 'is the catalog path' do expect(render.css('a').first['href']).to eq '/catalog?view=abc' end end context 'when the current view type is the default' do before do controller.params[:view] = 'list' end it 'does not include the current view type' do expect(render.css('a').first['href']).to eq '/catalog' end end end
Version data entries
49 entries across 48 versions & 2 rubygems