Skip to content

Commit

Permalink
Move AS relationship into relationships section in work show UI
Browse files Browse the repository at this point in the history
Pulled over from Hyrax: samvera/hyrax@cd5e4e6
  • Loading branch information
mjgiarlo committed Feb 14, 2017
1 parent 1b5faef commit 881ff5d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/views/curation_concerns/base/_attribute_rows.html.erb
@@ -1,6 +1,5 @@
<%= presenter.attribute_to_html(:creator, render_as: :faceted) %>
<%= presenter.attribute_to_html(:contributor, render_as: :faceted) %>
<%= presenter.attribute_to_html(:admin_set, render_as: :faceted) %>
<%= presenter.attribute_to_html(:subject, render_as: :faceted) %>
<%= presenter.attribute_to_html(:publisher, render_as: :faceted) %>
<%= presenter.attribute_to_html(:language, render_as: :faceted) %>
Expand Down
Expand Up @@ -21,3 +21,5 @@
<% end %>
<% end %>
<% end %>
<%= presenter.attribute_to_html(:admin_set, render_as: :faceted) %>
1 change: 1 addition & 0 deletions config/locales/sufia.en.yml
Expand Up @@ -504,6 +504,7 @@ en:
search:
fields:
show:
admin_set: In Admin Set:
based_near: Location
contributor: Contributors
keyword: Keyword
Expand Down
Expand Up @@ -2,7 +2,7 @@

describe 'curation_concerns/base/relationships', type: :view do
let(:ability) { double }
let(:solr_doc) { double(id: '123', human_readable_type: 'Work') }
let(:solr_doc) { double(id: '123', human_readable_type: 'Work', admin_set_id: nil) }
let(:presenter) { Sufia::WorkShowPresenter.new(solr_doc, ability) }
let(:generic_work) { GenericWork.new(id: '456', title: ['Containing work']) }
let(:collection) { Collection.new(id: '345', title: ['Containing collection']) }
Expand Down Expand Up @@ -86,4 +86,12 @@
expect(page).not_to have_content "There are no Generic work relationships."
end
end

context 'with admin sets' do
it 'renders using attribute_to_html' do
allow(solr_doc).to receive(:member_of_collection_ids).and_return([])
expect(presenter).to receive(:attribute_to_html).with(:admin_set, render_as: :faceted)
render 'curation_concerns/base/relationships', presenter: presenter
end
end
end

0 comments on commit 881ff5d

Please sign in to comment.