Sha256: 1baf9c52e844c4870ae8197eb217eeb5e7c8b6d9b51e2f9bd2b30095376a672f

Contents?: true

Size: 880 Bytes

Versions: 36

Compression:

Stored size: 880 Bytes

Contents

# frozen_string_literal: true

describe "_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 :partial => "user_util_links"
    expect(rendered).to have_selector('#bookmarks_nav span[data-role=bookmark-counter]', text: "#{count}")
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.24.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.23.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.22.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.21.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.20.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.19.2 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.19.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.19.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.18.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.17.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.16.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.15.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.14.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.14.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.13.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.12.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.11.2 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.11.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-6.11.0 spec/views/_user_util_links.html.erb_spec.rb