Skip to content

Commit

Permalink
Merge pull request #180 from sul-dlss/179-remove-scale-not-given
Browse files Browse the repository at this point in the history
remove scale not given
  • Loading branch information
thatbudakguy authored Mar 1, 2024
2 parents 947de6b + 3daaf7a commit 970287c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/mods_display/fields/cartographics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def fields
next unless subject_element.respond_to?(:cartographics)

subject_element.cartographics.each do |field|
scale = field.scale.empty? ? 'Scale not given' : element_text(field.scale)
scale = field.scale.empty? ? nil : element_text(field.scale)
projection = field.projection.empty? ? nil : element_text(field.projection)
coordinates = field.coordinates.empty? ? nil : element_text(field.coordinates)
post_scale = [projection, coordinates].compact.join(' ') if [projection, coordinates].compact.length.positive?
Expand Down
4 changes: 2 additions & 2 deletions spec/fields/cartographics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def mods_display_cartographics(mods)
it 'puts a scale not given note if no scale is present' do
values = mods_display_cartographics(@no_scale).fields
expect(values.length).to eq(1)
expect(values.first.values).to eq(['Scale not given ; the projection the coordinates'])
expect(values.first.values).to eq(['the projection the coordinates'])
end

it 'handles when there is only a scale note' do
Expand All @@ -37,7 +37,7 @@ def mods_display_cartographics(mods)
it 'handles when only one post-scale piece of the data is available' do
values = mods_display_cartographics(@coordinates).fields
expect(values.length).to eq(1)
expect(values.first.values).to eq(['Scale not given ; the coordinates'])
expect(values.first.values).to eq(['the coordinates'])
end
end
end
2 changes: 1 addition & 1 deletion spec/helpers/record_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe 'mods_display_label' do
it 'returns correct label' do
expect(helper.mods_display_label('test:')).not_to have_content ':'
expect(helper.mods_display_label('test:')).to have_no_content ':'
expect(helper.mods_display_label('test:')).to have_css('dt', text: 'test')
end
end
Expand Down

0 comments on commit 970287c

Please sign in to comment.