Skip to content

Commit f2fdea6

Browse files
committed
comments
1 parent 42c9982 commit f2fdea6

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

lib/ingestors/taxila/citizen_science_ingestor.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def process_citizen_science_events(_url)
3737
&.css('.row')&.first
3838
&.css('.card')
3939

40+
return if overview_page.nil?
41+
4042
overview_page.each_with_index do |el, _idx|
4143
event = OpenStruct.new
4244
event.url = el.css('a.btn').first['href']
@@ -80,18 +82,18 @@ def process_citizen_science_materials(_url)
8082
end
8183
end
8284
end
83-
end
84-
end
85-
end
8685

87-
def citizen_science_month_mapping(str)
88-
mapping = [
89-
%w[Mrt Mar],
90-
%w[Mei May],
91-
%w[Okt Oct]
92-
]
93-
mapping.each do |dutch, english|
94-
str = str.gsub(dutch, english)
86+
def citizen_science_month_mapping(str)
87+
mapping = [
88+
%w[Mrt Mar],
89+
%w[Mei May],
90+
%w[Okt Oct]
91+
]
92+
mapping.each do |dutch, english|
93+
str = str.gsub(dutch, english)
94+
end
95+
str
96+
end
97+
end
9598
end
96-
str
9799
end

test/unit/ingestors/taxila/citizen_science_ingestor_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CitizenScienceIngestorTest < ActiveSupport::TestCase
1717

1818
ingestor = Ingestors::Taxila::CitizenScienceIngestor.new
1919

20-
# check event doesn't
20+
# check event doesn't exist yet
2121
new_title = 'High-Level Policy Event on the Sustainability of Citizen Science'
2222
new_url = 'https://events.teams.microsoft.com/event/47581424-c548-4f07-928a-9fed358df416@659b3608-37a1-406b-9e1a-02c011decd3c'
2323
refute Event.where(title: new_title, url: new_url).any?
@@ -61,7 +61,7 @@ class CitizenScienceIngestorTest < ActiveSupport::TestCase
6161

6262
ingestor = Ingestors::Taxila::CitizenScienceIngestor.new
6363

64-
# check event doesn't
64+
# check material doesn't exist yet
6565
new_title = 'Naar een vaste plek voor burgerwetenschap in het netwerk van openbare bibliotheken'
6666
new_url = 'https://www.citizenscience.nl/resource/475'
6767
refute Material.where(title: new_title, url: new_url).any?

0 commit comments

Comments
 (0)