Skip to content

Commit

Permalink
Merge pull request #144 from projecthydra/trailing_slash
Browse files Browse the repository at this point in the history
Add trailing slashes to geonames uris
  • Loading branch information
mjgiarlo committed May 1, 2017
2 parents 62f1b1b + 895b3d2 commit 3720265
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/qa/authorities/geonames.rb
Expand Up @@ -38,7 +38,8 @@ def find_url(id)
# Reformats the data received from the service
def parse_authority_response(response)
response['geonames'].map do |result|
{ 'id' => "http://sws.geonames.org/#{result['geonameId']}",
# Note: the trailing slash is meaningful.
{ 'id' => "http://sws.geonames.org/#{result['geonameId']}/",
'label' => label.call(result) }
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/authorities/geonames_spec.rb
Expand Up @@ -28,9 +28,9 @@

context "with default label" do
it "has id and label keys" do
expect(subject.first).to eq("id" => 'http://sws.geonames.org/2088122',
expect(subject.first).to eq("id" => 'http://sws.geonames.org/2088122/',
"label" => "Port Moresby, National Capital, Papua New Guinea")
expect(subject.last).to eq("id" => 'http://sws.geonames.org/377039',
expect(subject.last).to eq("id" => 'http://sws.geonames.org/377039/',
"label" => "Port Sudan, Red Sea, Sudan")
expect(subject.size).to eq(10)
end
Expand Down

0 comments on commit 3720265

Please sign in to comment.