Skip to content

Commit

Permalink
Updates label for based near on the work show page. Adds source to sh…
Browse files Browse the repository at this point in the history
…ow view. Tests for the presence of source field and that based near is labeled location.
  • Loading branch information
mtribone committed Aug 25, 2016
1 parent 90a96bc commit 2b0c5df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/views/curation_concerns/base/_attribute_rows.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<%= presenter.attribute_to_html(:identifier, render_as: :linked, search_field: 'identifier_tesim') %>
<%= presenter.attribute_to_html(:keyword, render_as: :faceted) %>
<%= presenter.attribute_to_html(:date_created, render_as: :linked, search_field: 'date_created_tesim') %>
<%= presenter.attribute_to_html(:based_near, render_as: :faceted) %>
<%= presenter.attribute_to_html(:based_near, label: 'Location', render_as: :faceted) %>
<%= presenter.attribute_to_html(:related_url) %>
<%= presenter.attribute_to_html(:resource_type, render_as: :faceted) %>
<%= presenter.attribute_to_html(:source) %>
10 changes: 8 additions & 2 deletions spec/features/work_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let(:work_path) { "/concern/generic_works/#{work.id}" }

context "as the work owner" do
let(:work) { create(:work_with_one_file, title: ["Magnificent splendor"], user: user) }
let(:work) { create(:work_with_one_file, title: ["Magnificent splendor"], source: ["The Internet"], based_near: ["USA"], user: user) }
let(:user) { create(:user) }
before do
sign_in user
Expand All @@ -11,6 +11,9 @@

it "shows a work" do
expect(page).to have_selector 'h1', text: 'Magnificent splendor'
expect(page).to have_selector 'li', text: 'The Internet'
expect(page).to have_selector 'th', text: 'Location'
expect(page).not_to have_selector 'th', text: 'Based near'

# Displays FileSets already attached to this work
within '.related-files' do
Expand All @@ -20,13 +23,16 @@
end

context "as a user who is not logged in" do
let(:work) { create(:public_generic_work, title: ["Magnificent splendor"]) }
let(:work) { create(:public_generic_work, title: ["Magnificent splendor"], source: ["The Internet"], based_near: ["USA"]) }
before do
visit work_path
end

it "shows a work" do
expect(page).to have_selector 'h1', text: 'Magnificent splendor'
expect(page).to have_selector 'li', text: 'The Internet'
expect(page).to have_selector 'th', text: 'Location'
expect(page).not_to have_selector 'th', text: 'Based near'

# Doesn't have the upload form for uploading more files
expect(page).not_to have_selector "form#fileupload"
Expand Down

0 comments on commit 2b0c5df

Please sign in to comment.