Sha256: a69bfa63712628db540c58f8d8cad5659904848aaad5e57104673c05574368f5

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'

describe "_user_util_links" do

  let :blacklight_config do
    Blacklight::Configuration.new
  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

3 entries across 3 versions & 1 rubygems

Version Path
blacklight-5.7.2 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.7.1 spec/views/_user_util_links.html.erb_spec.rb
blacklight-5.7.0 spec/views/_user_util_links.html.erb_spec.rb