Skip to content

Commit 1137661

Browse files
committed
TIMDEX year to sym
1 parent 4e68d4b commit 1137661

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/models/normalize_timdex_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def normalize
1111
title:,
1212
creators:,
1313
source:,
14-
'year' => year,
14+
year:,
1515
'format' => format,
1616
'links' => links,
1717
'citation' => citation,

test/models/normalize_timdex_record_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ def minimal_record
4949

5050
test 'extracts year from publication date' do
5151
normalized = NormalizeTimdexRecord.new(full_record, 'test').normalize
52-
assert_equal '2023', normalized['year']
52+
assert_equal '2023', normalized[:year]
5353
end
5454

5555
test 'handles missing year' do
5656
normalized = NormalizeTimdexRecord.new(minimal_record, 'test').normalize
57-
assert_nil normalized['year']
57+
assert_nil normalized[:year]
5858
end
5959

6060
test 'extracts year from fallback date when no publication date' do
@@ -64,7 +64,7 @@ def minimal_record
6464
{ 'kind' => 'Creation', 'value' => 'Created in 1998' }
6565
]
6666
normalized = NormalizeTimdexRecord.new(record_with_coverage_date, 'test').normalize
67-
assert_equal '1995', normalized['year']
67+
assert_equal '1995', normalized[:year]
6868
end
6969

7070
test 'normalizes format from content type' do

test/models/normalize_timdex_results_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def empty_timdex_response
2424
assert_equal 'test-record-123', first_result['identifier']
2525
assert_equal 'Test Repository', first_result[:source]
2626
assert_equal 'Dataset ; Geospatial data', first_result['format']
27-
assert_equal '2023', first_result['year']
27+
assert_equal '2023', first_result[:year]
2828

2929
# Check TIMDEX-specific fields are preserved
3030
assert_includes first_result.keys, 'content_type'

0 commit comments

Comments
 (0)