Sha256: cf8c5df49a215182de26ff835fbef81a701d74a544376154d0c81a432bd94ce0

Contents?: true

Size: 872 Bytes

Versions: 34

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'

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 "should render the correct bookmark count" do
    count = rand(99)
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    allow(view).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

34 entries across 34 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.19.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.19.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.18.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.17.2 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.17.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.17.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.16.4 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.16.3 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.16.2 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.16.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.16.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.15.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.14.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.13.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.13.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.11.3 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.12.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.12.0 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.10.3 spec/views/_user_util_links.html.erb_spec.rb