Skip to content

Commit cf25329

Browse files
committed
TIMDEX dates to sym
1 parent 13d880e commit cf25329

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

app/models/normalize_timdex_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def normalize
2222
subjects:,
2323
# TIMDEX-specific fields
2424
content_type:,
25-
'dates' => dates,
25+
dates:,
2626
contributors:,
2727
'highlight' => highlight,
2828
'source_link' => source_link

app/views/search/_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<p class="pub-info">
99
<span><%= result[:content_type]&.each { |type| type['value'] }&.join(' ; ') %></span>
1010
<span>
11-
<% result['dates']&.each do |date| %>
11+
<% result[:dates]&.each do |date| %>
1212
<%= date['value'] if date['kind'] == 'Publication date' %>
1313
<% end %>
1414
</span>

test/models/normalize_timdex_record_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def minimal_record
180180
{ 'kind' => 'Publication date', 'value' => '2023-01-15' },
181181
{ 'kind' => 'Coverage', 'value' => '2020-2023' }
182182
]
183-
assert_equal expected_dates, normalized['dates']
183+
assert_equal expected_dates, normalized[:dates]
184184
end
185185

186186
test 'includes TIMDEX-specific contributors field' do

test/models/normalize_timdex_results_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def empty_timdex_response
2828

2929
# Check TIMDEX-specific fields are preserved
3030
assert_includes first_result.keys, :content_type
31-
assert_includes first_result.keys, 'dates'
31+
assert_includes first_result.keys, :dates
3232
assert_includes first_result.keys, :contributors
3333
assert_includes first_result.keys, 'highlight'
3434
assert_includes first_result.keys, 'source_link'

0 commit comments

Comments
 (0)