Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/workers/occurrences_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def filter_pii_param(param)
when Hash
param.each do |representation, value|
next if %w(language class_name).include?(representation)
param[representation] = filter_pii_string(value)
param[representation] = filter_pii_param(value)
end
end
end
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/workers/occurrences_worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@
occ = OccurrencesWorker.new(@params).perform
expect(occ.ivars['email']).to eql('[EMAIL?]')
end

it "should handle nils gracefully" do
@params['ivars'] = {"foo" => { "email" => nil },
"other" => "something"}
expect {
occ = OccurrencesWorker.new(@params).perform
}.not_to raise_error
end
end

it "should stick any attributes it doesn't recognize into the metadata attribute" do
Expand Down