Skip to content

Commit

Permalink
Refworks should not be run in a modal window. Fixes #1042
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Dec 12, 2014
1 parent d9afdef commit 6fa3c43
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/blacklight/catalog/component_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Catalog::ComponentConfiguration
add_results_collection_tool(:view_type_group)

add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?)
add_show_tools_partial(:refworks, if: :render_refworks_action?)
add_show_tools_partial(:refworks, if: :render_refworks_action?, modal: false)
add_show_tools_partial(:endnote, if: :render_endnote_action? )
add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params)
add_show_tools_partial(:sms, callback: :sms_action, validator: :validate_sms_params)
Expand Down
21 changes: 21 additions & 0 deletions spec/views/catalog/_document_action.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'spec_helper'

describe 'catalog/_document_action' do
let(:document_action_config) { Blacklight::Configuration::ToolConfig.new(tool_config) }
let(:document) { SolrDocument.new(id: '123') }

before do
allow(view).to receive_messages(controller_name: 'catalog')
render 'catalog/document_action', document_action_config: document_action_config, document: document
end

context "for refworks" do
let(:tool_config) { { if: :render_refworks_action?, partial: "document_action",
name: :refworks, key: :refworks, modal: false } }

it "should not be modal" do
expect(rendered).to have_link('Export to Refworks')
expect(rendered).not_to have_selector('a[data-ajax-modal]')
end
end
end

0 comments on commit 6fa3c43

Please sign in to comment.