Sha256: c8a9be56735576ddbde35f8e5ee4db5637b6c3b20e3916e1d5348358b7045cea

Contents?: true

Size: 895 Bytes

Versions: 1

Compression:

Stored size: 895 Bytes

Contents

# frozen_string_literal: true

RSpec.describe "shared/_user_util_links" do

  let(:blacklight_config) do
    Blacklight::Configuration.new.configure do |config|
      config.navbar.partials = { bookmark: Blacklight::Configuration::ToolConfig.new(partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?) }
    end

  end

  it "renders the correct bookmark count" do
    count = rand(99)
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    allow(controller).to receive(:render_bookmarks_control?).and_return true
    allow(view).to receive(:has_user_authentication_provider?).and_return false
    allow(view).to receive_message_chain(:current_or_guest_user, :bookmarks, :count).and_return(count)
    render "shared/user_util_links"
    expect(rendered).to have_selector('#bookmarks_nav span.badge[data-role=bookmark-counter]', text: "#{count}")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-7.0.0.rc1 spec/views/shared/_user_util_links.html.erb_spec.rb