Sha256: dee9fe428876404d99bd799b516602b0a38ce27c160190f86a7c472438156a79
Contents?: true
Size: 1.33 KB
Versions: 8
Compression:
Stored size: 1.33 KB
Contents
require 'spec_helper' describe 'catalog/_show_tools.html.erb', type: :view do let(:document) { SolrDocument.new id: 'xyz', format: 'a' } let(:blacklight_config) { Blacklight::Configuration.new } let(:context) { Blacklight::Configuration::Context.new(controller) } before do assign :response, instance_double(Blacklight::Solr::Response, params: {}) assign :document, document allow(view).to receive(:blacklight_config).and_return blacklight_config allow(view).to receive(:has_user_authentication_provider?).and_return false allow(view).to receive(:blacklight_configuration_context).and_return context end describe 'document actions' do let(:document_actions) { blacklight_config.show.document_actions } it 'renders a document action' do allow(view).to receive(:some_action_solr_document_path).with(document).and_return 'x' document_actions[:some_action] = Blacklight::Configuration::ToolConfig.new partial: 'document_action' render partial: 'catalog/show_tools' expect(rendered).to have_link 'Some action', href: 'x' end context 'without any document actions defined' do before do document_actions.clear end it 'does not display the tools' do render partial: 'catalog/show_tools' expect(rendered).to be_blank end end end end
Version data entries
8 entries across 8 versions & 1 rubygems