Sha256: 12e216350f67cfcc62e2ef1ee3f07bcc12a5a2ab920f67018b2f514c8d9e33ac

Contents?: true

Size: 892 Bytes

Versions: 88

Compression:

Stored size: 892 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.to_s)
  end
end

Version data entries

88 entries across 88 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.39.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.38.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-7.37.0/spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.2.2 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.2.1 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.2.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.37.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.36.2 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.36.1 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.36.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.35.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.1.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-7.34.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.0.1 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.0.0 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.0.0.beta8 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.0.0.beta7 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.0.0.beta6 spec/views/shared/_user_util_links.html.erb_spec.rb
blacklight-8.0.0.beta5 spec/views/shared/_user_util_links.html.erb_spec.rb