Skip to content

Commit 9732cac

Browse files
committed
TIMDEX publisher and location to sym
1 parent a0a0965 commit 9732cac

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/models/normalize_timdex_record.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def normalize
1717
citation:,
1818
identifier:,
1919
summary:,
20-
'publisher' => publisher,
21-
'location' => location,
20+
publisher:,
21+
location:,
2222
'subjects' => subjects,
2323
# TIMDEX-specific fields
2424
'content_type' => content_type,

test/models/normalize_timdex_record_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,22 @@ def minimal_record
125125

126126
test 'extracts publisher from contributors' do
127127
normalized = NormalizeTimdexRecord.new(full_record, 'test').normalize
128-
assert_equal 'MIT Libraries', normalized['publisher']
128+
assert_equal 'MIT Libraries', normalized[:publisher]
129129
end
130130

131131
test 'handles missing publisher' do
132132
normalized = NormalizeTimdexRecord.new(minimal_record, 'test').normalize
133-
assert_nil normalized['publisher']
133+
assert_nil normalized[:publisher]
134134
end
135135

136136
test 'normalizes location' do
137137
normalized = NormalizeTimdexRecord.new(full_record, 'test').normalize
138-
assert_equal 'Cambridge, MA', normalized['location']
138+
assert_equal 'Cambridge, MA', normalized[:location]
139139
end
140140

141141
test 'handles missing location' do
142142
normalized = NormalizeTimdexRecord.new(minimal_record, 'test').normalize
143-
assert_nil normalized['location']
143+
assert_nil normalized[:location]
144144
end
145145

146146
test 'joins multiple locations with semicolon' do
@@ -151,7 +151,7 @@ def minimal_record
151151
{ 'value' => 'New York, NY' }
152152
]
153153
normalized = NormalizeTimdexRecord.new(record_with_multiple_locations, 'test').normalize
154-
assert_equal 'Cambridge, MA; Boston, MA; New York, NY', normalized['location']
154+
assert_equal 'Cambridge, MA; Boston, MA; New York, NY', normalized[:location]
155155
end
156156

157157
test 'normalizes subjects' do

0 commit comments

Comments
 (0)