Sha256: f33cce68b13eb4c1bd13c1bc09a066975af780cd9f8adadbf6a0337a4b97915f

Contents?: true

Size: 846 Bytes

Versions: 8

Compression:

Stored size: 846 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(controller).to receive(:render_bookmarks_control?).and_return true
    allow(view).to receive_messages(blacklight_config: blacklight_config, has_user_authentication_provider?: 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_css('#bookmarks_nav span.badge[data-role=bookmark-counter]', text: count.to_s)
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
blacklight-8.7.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.6.1 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.6.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.5.1 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.5.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.4.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.3.0 spec/views/shared/_user_util_links.html.erb_spec.rb