Skip to content

Commit

Permalink
Merge pull request #3890 from pulibrary/3885-date-to
Browse files Browse the repository at this point in the history
Change "-" to "to" in date range display on person decorator
  • Loading branch information
eliotjordan authored May 11, 2020
2 parents 97b0d6c + 62d85fa commit 550d26f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def title
private

def date_range
return "(#{born&.first} - #{died&.first})" unless born.blank? && died.blank?
return "(#{years_active_start&.first} - #{years_active_end&.first})" unless years_active_start.blank? && years_active_end.blank?
return "(#{born&.first} to #{died&.first})" unless born.blank? && died.blank?
return "(#{years_active_start&.first} to #{years_active_end&.first})" unless years_active_start.blank? && years_active_end.blank?
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
issue
end
it "returns a pub_created_display" do
expect(decorator.pub_created_display).to eq("name1 name2 epithet (1868 - 1963), 1/2 Penny")
expect(decorator.pub_created_display).to eq("name1 name2 epithet (1868 to 1963), 1/2 Penny")
end
end
context "when the coin is not attached to a numismatic issue" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
expect(page).to have_css ".attribute.denomination", text: "test value"
expect(page).to have_css ".attribute.edge", text: "test value"
expect(page).to have_css ".attribute.era", text: "test value"
expect(page).to have_css ".attribute.master", text: "name1 name2 epithet (1868 - 1963)"
expect(page).to have_css ".attribute.master", text: "name1 name2 epithet (1868 to 1963)"
expect(page).to have_css ".attribute.metal", text: "test value"
expect(page).to have_css ".attribute.notes", text: "note"
expect(page).to have_css ".attribute.object_date", text: "test value"
Expand All @@ -228,7 +228,7 @@
expect(page).to have_css ".attribute.reverse_orientation", text: "test value"
expect(page).to have_css ".attribute.reverse_part", text: "test value"
expect(page).to have_css ".attribute.reverse_symbol", text: "test value"
expect(page).to have_css ".attribute.rulers", text: "name1 name2 epithet (1868 - 1963)"
expect(page).to have_css ".attribute.rulers", text: "name1 name2 epithet (1868 to 1963)"
expect(page).to have_css ".attribute.series", text: "test value"
expect(page).to have_css ".attribute.shape", text: "test value"
expect(page).to have_css ".attribute.subjects", text: "Animal, unicorn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
describe "#title" do
context "with a born and died date" do
it "generates a title" do
expect(decorator.title).to eq("name1 name2 epithet (1868 - 1963)")
expect(decorator.title).to eq("name1 name2 epithet (1868 to 1963)")
end
end

Expand All @@ -30,7 +30,7 @@
end

it "generates a title" do
expect(decorator.title).to eq("name1 name2 epithet ( - 1963)")
expect(decorator.title).to eq("name1 name2 epithet ( to 1963)")
end
end

Expand All @@ -44,7 +44,7 @@
end

it "generates a title" do
expect(decorator.title).to eq("name1 name2 epithet (1894 - )")
expect(decorator.title).to eq("name1 name2 epithet (1894 to )")
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/services/orangelight_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
holding = JSON.parse(output[:holdings_1display]).first.last
expect(output[:id]).to eq coin.decorate.orangelight_id
expect(output[:title_display]).to eq "Coin: #{coin.coin_number}"
expect(output[:pub_created_display]).to eq "name1 name2 epithet (1868 - 1963), 1/2 Penny, city"
expect(output[:pub_created_display]).to eq "name1 name2 epithet (1868 to 1963), 1/2 Penny, city"
expect(output[:call_number_display]).to eq ["Coin #{coin.coin_number}"]
expect(output[:call_number_browse_s]).to eq ["Coin #{coin.coin_number}"]
expect(output[:access_facet]).to eq ["Online", "In the Library"]
Expand Down Expand Up @@ -134,9 +134,9 @@
expect(output[:issue_color_s]).to eq ["green"]
expect(output[:issue_edge_s]).to eq ["GOTT MIT UNS"]
expect(output[:issue_era_s]).to eq ["uncertain"]
expect(output[:issue_ruler_s]).to eq ["name1 name2 epithet (1868 - 1963)"]
expect(output[:issue_ruler_sort]).to eq "name1 name2 epithet (1868 - 1963)"
expect(output[:issue_master_s]).to eq ["name1 name2 epithet (1868 - 1963)"]
expect(output[:issue_ruler_s]).to eq ["name1 name2 epithet (1868 to 1963)"]
expect(output[:issue_ruler_sort]).to eq "name1 name2 epithet (1868 to 1963)"
expect(output[:issue_master_s]).to eq ["name1 name2 epithet (1868 to 1963)"]
expect(output[:issue_workshop_s]).to eq ["Bristol"]
expect(output[:issue_series_s]).to eq ["Hibernia"]
expect(output[:issue_place_s]).to eq ["city, state, region"]
Expand Down

0 comments on commit 550d26f

Please sign in to comment.