From 751c96ba3063cf197683dbf751c8df2f4c4690e3 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Wed, 8 May 2019 08:24:03 +0200 Subject: [PATCH] update graphql orcid support. #255 --- app/models/researcher.rb | 6 +++--- spec/fixtures/vcr_cassettes/Researcher/find_by_id/found.yml | 6 +++--- .../vcr_cassettes/Researcher/find_by_id/not_found.yml | 6 +++--- spec/models/researcher_spec.rb | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/models/researcher.rb b/app/models/researcher.rb index ce834e5dd..f50379ebd 100644 --- a/app/models/researcher.rb +++ b/app/models/researcher.rb @@ -15,9 +15,9 @@ def self.find_by_id(id) def self.parse_message(id: nil, message: nil) { id: id, - given_name: message.dig("name", "given-names", "value"), - family_name: message.dig("name", "family-name", "value"), - name: message.dig("name", "credit-name", "value") }.compact + name: message.dig("name", "credit-name", "value"), + "givenName" => message.dig("name", "given-names", "value"), + "familyName" => message.dig("name", "family-name", "value") }.compact end def self.orcid_from_url(url) diff --git a/spec/fixtures/vcr_cassettes/Researcher/find_by_id/found.yml b/spec/fixtures/vcr_cassettes/Researcher/find_by_id/found.yml index c69de197a..e9e7f936c 100644 --- a/spec/fixtures/vcr_cassettes/Researcher/find_by_id/found.yml +++ b/spec/fixtures/vcr_cassettes/Researcher/find_by_id/found.yml @@ -23,7 +23,7 @@ http_interactions: Content-Type: - application/vnd.orcid+json; qs=4;charset=UTF-8 Date: - - Sun, 05 May 2019 10:30:03 GMT + - Tue, 07 May 2019 19:04:30 GMT Expires: - '0' Pragma: @@ -37,7 +37,7 @@ http_interactions: Connection: - keep-alive Set-Cookie: - - X-Mapping-fjhppofk=286B142B3C5849CB06CC59D0E32CD23F; path=/ + - X-Mapping-fjhppofk=FAC9A421C8E47CC7F8C08879007190C1; path=/ X-Frame-Options: - DENY body: @@ -45,5 +45,5 @@ http_interactions: string: !binary |- ewogICJsYXN0LW1vZGlmaWVkLWRhdGUiIDogewogICAgInZhbHVlIiA6IDE1MTc4NzMyNTY2MzYKICB9LAogICJuYW1lIiA6IHsKICAgICJjcmVhdGVkLWRhdGUiIDogewogICAgICAidmFsdWUiIDogMTQ2MDc2MzY2NDQwNQogICAgfSwKICAgICJsYXN0LW1vZGlmaWVkLWRhdGUiIDogewogICAgICAidmFsdWUiIDogMTQ2MDc2MzY2NDQwNQogICAgfSwKICAgICJnaXZlbi1uYW1lcyIgOiB7CiAgICAgICJ2YWx1ZSIgOiAiTWFydGluIgogICAgfSwKICAgICJmYW1pbHktbmFtZSIgOiB7CiAgICAgICJ2YWx1ZSIgOiAiRmVubmVyIgogICAgfSwKICAgICJjcmVkaXQtbmFtZSIgOiB7CiAgICAgICJ2YWx1ZSIgOiAiTWFydGluIEZlbm5lciIKICAgIH0sCiAgICAic291cmNlIiA6IG51bGwsCiAgICAidmlzaWJpbGl0eSIgOiAiUFVCTElDIiwKICAgICJwYXRoIiA6ICIwMDAwLTAwMDMtMTQxOS0yNDA1IgogIH0sCiAgIm90aGVyLW5hbWVzIiA6IHsKICAgICJsYXN0LW1vZGlmaWVkLWRhdGUiIDogewogICAgICAidmFsdWUiIDogMTQ0Njc2MDcwMzcyMgogICAgfSwKICAgICJvdGhlci1uYW1lIiA6IFsgewogICAgICAiY3JlYXRlZC1kYXRlIiA6IHsKICAgICAgICAidmFsdWUiIDogMTQwNjgzNjQyMTY5OQogICAgICB9LAogICAgICAibGFzdC1tb2RpZmllZC1kYXRlIiA6IHsKICAgICAgICAidmFsdWUiIDogMTQwNjgzNjQyMTY5OQogICAgICB9LAogICAgICAic291cmNlIiA6IHsKICAgICAgICAic291cmNlLW9yY2lkIiA6IHsKICAgICAgICAgICJ1cmkiIDogImh0dHBzOi8vb3JjaWQub3JnLzAwMDAtMDAwMy0xNDE5LTI0MDUiLAogICAgICAgICAgInBhdGgiIDogIjAwMDAtMDAwMy0xNDE5LTI0MDUiLAogICAgICAgICAgImhvc3QiIDogIm9yY2lkLm9yZyIKICAgICAgICB9LAogICAgICAgICJzb3VyY2UtY2xpZW50LWlkIiA6IG51bGwsCiAgICAgICAgInNvdXJjZS1uYW1lIiA6IHsKICAgICAgICAgICJ2YWx1ZSIgOiAiTWFydGluIEZlbm5lciIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJjb250ZW50IiA6ICJNIEZlbm5lciIsCiAgICAgICJ2aXNpYmlsaXR5IiA6ICJQVUJMSUMiLAogICAgICAicGF0aCIgOiAiLzAwMDAtMDAwMy0xNDE5LTI0MDUvb3RoZXItbmFtZXMvMjQ3MDQzIiwKICAgICAgInB1dC1jb2RlIiA6IDI0NzA0MywKICAgICAgImRpc3BsYXktaW5kZXgiIDogMAogICAgfSwgewogICAgICAiY3JlYXRlZC1kYXRlIiA6IHsKICAgICAgICAidmFsdWUiIDogMTQwNjgzNjQyMTcwMAogICAgICB9LAogICAgICAibGFzdC1tb2RpZmllZC1kYXRlIiA6IHsKICAgICAgICAidmFsdWUiIDogMTQwNjgzNjQyMTcwMAogICAgICB9LAogICAgICAic291cmNlIiA6IHsKICAgICAgICAic291cmNlLW9yY2lkIiA6IHsKICAgICAgICAgICJ1cmkiIDogImh0dHBzOi8vb3JjaWQub3JnLzAwMDAtMDAwMy0xNDE5LTI0MDUiLAogICAgICAgICAgInBhdGgiIDogIjAwMDAtMDAwMy0xNDE5LTI0MDUiLAogICAgICAgICAgImhvc3QiIDogIm9yY2lkLm9yZyIKICAgICAgICB9LAogICAgICAgICJzb3VyY2UtY2xpZW50LWlkIiA6IG51bGwsCiAgICAgICAgInNvdXJjZS1uYW1lIiA6IHsKICAgICAgICAgICJ2YWx1ZSIgOiAiTWFydGluIEZlbm5lciIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJjb250ZW50IiA6ICJNSCBGZW5uZXIiLAogICAgICAidmlzaWJpbGl0eSIgOiAiUFVCTElDIiwKICAgICAgInBhdGgiIDogIi8wMDAwLTAwMDMtMTQxOS0yNDA1L290aGVyLW5hbWVzLzI0NzA0NCIsCiAgICAgICJwdXQtY29kZSIgOiAyNDcwNDQsCiAgICAgICJkaXNwbGF5LWluZGV4IiA6IDAKICAgIH0sIHsKICAgICAgImNyZWF0ZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0MzgzMjE1ODM5OTQKICAgICAgfSwKICAgICAgImxhc3QtbW9kaWZpZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0MzgzMjE1ODM5OTQKICAgICAgfSwKICAgICAgInNvdXJjZSIgOiB7CiAgICAgICAgInNvdXJjZS1vcmNpZCIgOiB7CiAgICAgICAgICAidXJpIiA6ICJodHRwczovL29yY2lkLm9yZy8wMDAwLTAwMDMtMTQxOS0yNDA1IiwKICAgICAgICAgICJwYXRoIiA6ICIwMDAwLTAwMDMtMTQxOS0yNDA1IiwKICAgICAgICAgICJob3N0IiA6ICJvcmNpZC5vcmciCiAgICAgICAgfSwKICAgICAgICAic291cmNlLWNsaWVudC1pZCIgOiBudWxsLAogICAgICAgICJzb3VyY2UtbmFtZSIgOiB7CiAgICAgICAgICAidmFsdWUiIDogIk1hcnRpbiBGZW5uZXIiCiAgICAgICAgfQogICAgICB9LAogICAgICAiY29udGVudCIgOiAiTWFydGluIEguIEZlbm5lciIsCiAgICAgICJ2aXNpYmlsaXR5IiA6ICJQVUJMSUMiLAogICAgICAicGF0aCIgOiAiLzAwMDAtMDAwMy0xNDE5LTI0MDUvb3RoZXItbmFtZXMvNTA5ODQ2IiwKICAgICAgInB1dC1jb2RlIiA6IDUwOTg0NiwKICAgICAgImRpc3BsYXktaW5kZXgiIDogMAogICAgfSwgewogICAgICAiY3JlYXRlZC1kYXRlIiA6IHsKICAgICAgICAidmFsdWUiIDogMTQ0Njc2MDcwMzcyMgogICAgICB9LAogICAgICAibGFzdC1tb2RpZmllZC1kYXRlIiA6IHsKICAgICAgICAidmFsdWUiIDogMTQ0Njc2MDcwMzcyMgogICAgICB9LAogICAgICAic291cmNlIiA6IHsKICAgICAgICAic291cmNlLW9yY2lkIiA6IHsKICAgICA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AgIH0KICAgICAgfSwKICAgICAgInVybC1uYW1lIiA6ICJNeSBTY2lFTkNWIiwKICAgICAgInVybCIgOiB7CiAgICAgICAgInZhbHVlIiA6ICJodHRwOi8vd3d3Lm5jYmkubmxtLm5paC5nb3YvbXluY2JpL21mZW5uZXIvY3YvMTQxMy8iCiAgICAgIH0sCiAgICAgICJ2aXNpYmlsaXR5IiA6ICJQVUJMSUMiLAogICAgICAicGF0aCIgOiAiLzAwMDAtMDAwMy0xNDE5LTI0MDUvcmVzZWFyY2hlci11cmxzLzMzNDQxNSIsCiAgICAgICJwdXQtY29kZSIgOiAzMzQ0MTUsCiAgICAgICJkaXNwbGF5LWluZGV4IiA6IDQKICAgIH0sIHsKICAgICAgImNyZWF0ZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0MDY4MzY0MjE3MDIKICAgICAgfSwKICAgICAgImxhc3QtbW9kaWZpZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0ODAyNTUyMDAzOTQKICAgICAgfSwKICAgICAgInNvdXJjZSIgOiB7CiAgICAgICAgInNvdXJjZS1vcmNpZCIgOiB7CiAgICAgICAgICAidXJpIiA6ICJodHRwczovL29yY2lkLm9yZy8wMDAwLTAwMDMtMTQxOS0yNDA1IiwKICAgICAgICAgICJwYXRoIiA6ICIwMDAwLTAwMDMtMTQxOS0yNDA1IiwKICAgICAgICAgICJob3N0IiA6ICJvcmNpZC5vcmciCiAgICAgICAgfSwKICAgICAgICAic291cmNlLWNsaWVudC1pZCIgOiBudWxsLAogICAgICAgICJzb3VyY2UtbmFtZSIgOiB7CiAgICAgICAgICAidmFsdWUiIDogIk1hcnRpbiBGZW5uZXIiCiAgICAgICAgfQogICAgICB9LAogICAgICAidXJsLW5hbWUiIDogIlR3aXR0ZXIiLAogICAgICAidXJsIiA6IHsKICAgICAgICAidmFsdWUiIDogImh0dHA6Ly90d2l0dGVyLmNvbS9tZmVubmVyIgogICAgICB9LAogICAgICAidmlzaWJpbGl0eSIgOiAiUFVCTElDIiwKICAgICAgInBhdGgiIDogIi8wMDAwLTAwMDMtMTQxOS0yNDA1L3Jlc2VhcmNoZXItdXJscy8zMzQ0MTQiLAogICAgICAicHV0LWNvZGUiIDogMzM0NDE0LAogICAgICAiZGlzcGxheS1pbmRleCIgOiAzCiAgICB9LCB7CiAgICAgICJjcmVhdGVkLWRhdGUiIDogewogICAgICAgICJ2YWx1ZSIgOiAxNDA2ODM2NDIxNzAyCiAgICAgIH0sCiAgICAgICJsYXN0LW1vZGlmaWVkLWRhdGUiIDogewogICAgICAgICJ2YWx1ZSIgOiAxNDgwMjU1MjAwMzk0CiAgICAgIH0sCiAgICAgICJzb3VyY2UiIDogewogICAgICAgICJzb3VyY2Utb3JjaWQiIDogewogICAgICAgICAgInVyaSIgOiAiaHR0cHM6Ly9vcmNpZC5vcmcvMDAwMC0wMDAzLTE0MTktMjQwNSIsCiAgICAgICAgICAicGF0aCIgOiAiMDAwMC0wMDAzLTE0MTktMjQwNSIsCiAgICAgICAgICAiaG9zdCIgOiAib3JjaWQub3JnIgogICAgICAgIH0sCiAgICAgICAgInNvdXJjZS1jbGllbnQtaWQiIDogbnVsbCwKICAgICAgICAic291cmNlLW5hbWUiIDogewogICAgICAgICAgInZhbHVlIiA6ICJNYXJ0aW4gRmVubmVyIgogICAgICAgIH0KICAgICAgfSwKICAgICAgInVybC1uYW1lIiA6ICJCbG9nIiwKICAgICAgInVybCIgOiB7CiAgICAgICAgInZhbHVlIiA6ICJodHRwOi8vYmxvZy5tYXJ0aW5mZW5uZXIub3JnIgogICAgICB9LAogICAgICAidmlzaWJpbGl0eSIgOiAiUFVCTElDIiwKICAgICAgInBhdGgiIDogIi8wMDAwLTAwMDMtMTQxOS0yNDA1L3Jlc2VhcmNoZXItdXJscy8zMzQ0MTMiLAogICAgICAicHV0LWNvZGUiIDogMzM0NDEzLAogICAgICAiZGlzcGxheS1pbmRleCIgOiAyCiAgICB9IF0sCiAgICAicGF0aCIgOiAiLzAwMDAtMDAwMy0xNDE5LTI0MDUvcmVzZWFyY2hlci11cmxzIgogIH0sCiAgImVtYWlscyIgOiB7CiAgICAibGFzdC1tb2RpZmllZC1kYXRlIiA6IG51bGwsCiAgICAiZW1haWwiIDogWyBdLAogICAgInBhdGgiIDogIi8wMDAwLTAwMDMtMTQxOS0yNDA1L2VtYWlsIgogIH0sCiAgImFkZHJlc3NlcyIgOiB7CiAgICAibGFzdC1tb2RpZmllZC1kYXRlIiA6IHsKICAgICAgInZhbHVlIiA6IDE0NjUyMjY5NzY5NTIKICAgIH0sCiAgICAiYWRkcmVzcyIgOiBbIHsKICAgICAgImNyZWF0ZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0NTM2NjA0MjcxMTkKICAgICAgfSwKICAgICAgImxhc3QtbW9kaWZpZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0NjUyMjY5NzY5NTIKICAgICAgfSwKICAgICAgInNvdXJjZSIgOiB7CiAgICAgICAgInNvdXJjZS1vcmNpZCIgOiB7CiAgICAgICAgICAidXJpIiA6ICJodHRwczovL29yY2lkLm9yZy8wMDAwLTAwMDMtMTQxOS0yNDA1IiwKICAgICAgICAgICJwYXRoIiA6ICIwMDAwLTAwMDMtMTQxOS0yNDA1IiwKICAgICAgICAgICJob3N0IiA6ICJvcmNpZC5vcmciCiAgICAgICAgfSwKICAgICAgICAic291cmNlLWNsaWVudC1pZCIgOiBudWxsLAogICAgICAgICJzb3VyY2UtbmFtZSIgOiB7CiAgICAgICAgICAidmFsdWUiIDogIk1hcnRpbiBGZW5uZXIiCiAgICAgICAgfQogICAgICB9LAogICAgICAiY291bnRyeSIgOiB7CiAgICAgICAgInZhbHVlIiA6ICJERSIKICAgICAgfSwKICAgICAgInZpc2liaWxpdHkiIDogIlBVQkxJQyIsCiAgICAgICJwYXRoIiA6ICIvMDAwMC0wMDAzLTE0MTktMjQwNS9hZGRyZXNzLzM0ODA3MSIsCiAgICAgICJwdXQtY29kZSIgOiAzNDgwNzEsCiAgICAgICJkaXNwbGF5LWluZGV4IiA6IDAKICAgIH0gXSwKICAgICJwYXRoIiA6ICIvMDAwMC0wMDAzLTE0MTktMjQwNS9hZGRyZXNzIgogIH0sCiAgImtleXdvcmRzIiA6IHsKICAgICJsYXN0LW1vZGlmaWVkLWRhdGUiIDogbnVsbCwKICAgICJrZXl3b3JkIiA6IFsgXSwKICAgICJwYXRoIiA6ICIvMDAwMC0wMDAzLTE0MTktMjQwNS9rZXl3b3JkcyIKICB9LAogICJleHRlcm5hbC1pZGVudGlmaWVycyIgOiB7CiAgICAibGFzdC1tb2RpZmllZC1kYXRlIiA6IHsKICAgICAgInZhbHVlIiA6IDE1MTc4NzMyNTY2MzYKICAgIH0sCiAgICAiZXh0ZXJuYWwtaWRlbnRpZmllciIgOiBbIHsKICAgICAgImNyZWF0ZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDEzNzg5MjE4ODczMDQKICAgICAgfSwKICAgICAgImxhc3QtbW9kaWZpZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE1MTc4NzMyNTY2MzYKICAgICAgfSwKICAgICAgInNvdXJjZSIgOiB7CiAgICAgICAgInNvdXJjZS1vcmNpZCIgOiBudWxsLAogICAgICAgICJzb3VyY2UtY2xpZW50LWlkIiA6IHsKICAgICAgICAgICJ1cmkiIDogImh0dHBzOi8vb3JjaWQub3JnL2NsaWVudC8wMDAwLTAwMDItNTk4Mi04OTgzIiwKICAgICAgICAgICJwYXRoIiA6ICIwMDAwLTAwMDItNTk4Mi04OTgzIiwKICAgICAgICAgICJob3N0IiA6ICJvcmNpZC5vcmciCiAgICAgICAgfSwKICAgICAgICAic291cmNlLW5hbWUiIDogewogICAgICAgICAgInZhbHVlIiA6ICJTY29wdXMgLSBFbHNldmllciIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJleHRlcm5hbC1pZC10eXBlIiA6ICJTY29wdXMgQXV0aG9yIElEIiwKICAgICAgImV4dGVybmFsLWlkLXZhbHVlIiA6ICI3MDA2NjAwODI1IiwKICAgICAgImV4dGVybmFsLWlkLXVybCIgOiB7CiAgICAgICAgInZhbHVlIiA6ICJodHRwOi8vd3d3LnNjb3B1cy5jb20vaW53YXJkL2F1dGhvckRldGFpbHMudXJsP2F1dGhvcklEPTcwMDY2MDA4MjUmcGFydG5lcklEPU1OOFRPQVJTIgogICAgICB9LAogICAgICAiZXh0ZXJuYWwtaWQtcmVsYXRpb25zaGlwIiA6ICJTRUxGIiwKICAgICAgInZpc2liaWxpdHkiIDogIlBVQkxJQyIsCiAgICAgICJwYXRoIiA6ICIvMDAwMC0wMDAzLTE0MTktMjQwNS9leHRlcm5hbC1pZGVudGlmaWVycy8xNDM5MjgiLAogICAgICAicHV0LWNvZGUiIDogMTQzOTI4LAogICAgICAiZGlzcGxheS1pbmRleCIgOiAzCiAgICB9LCB7CiAgICAgICJjcmVhdGVkLWRhdGUiIDogewogICAgICAgICJ2YWx1ZSIgOiAxMzg3MzgyMjc3MjU5CiAgICAgIH0sCiAgICAgICJsYXN0LW1vZGlmaWVkLWRhdGUiIDogewogICAgICAgICJ2YWx1ZSIgOiAxNTE3ODczMjU2NjM2CiAgICAgIH0sCiAgICAgICJzb3VyY2UiIDogewogICAgICAgICJzb3VyY2Utb3JjaWQiIDogbnVsbCwKICAgICAgICAic291cmNlLWNsaWVudC1pZCIgOiB7CiAgICAgICAgICAidXJpIiA6ICJodHRwczovL29yY2lkLm9yZy9jbGllbnQvMDAwMC0wMDAzLTA0MTItMTg1NyIsCiAgICAgICAgICAicGF0aCIgOiAiMDAwMC0wMDAzLTA0MTItMTg1NyIsCiAgICAgICAgICAiaG9zdCIgOiAib3JjaWQub3JnIgogICAgICAgIH0sCiAgICAgICAgInNvdXJjZS1uYW1lIiA6IHsKICAgICAgICAgICJ2YWx1ZSIgOiAiSVNOSTJPUkNJRCBzZWFyY2ggYW5kIGxpbmsiCiAgICAgICAgfQogICAgICB9LAogICAgICAiZXh0ZXJuYWwtaWQtdHlwZSIgOiAiSVNOSSIsCiAgICAgICJleHRlcm5hbC1pZC12YWx1ZSIgOiAiMDAwMDAwMDM1MDYwNTQ5WCIsCiAgICAgICJleHRlcm5hbC1pZC11cmwiIDogewogICAgICAgICJ2YWx1ZSIgOiAiaHR0cDovL2lzbmkub3JnLzAwMDAwMDAzNTA2MDU0OVgiCiAgICAgIH0sCiAgICAgICJleHRlcm5hbC1pZC1yZWxhdGlvbnNoaXAiIDogIlNFTEYiLAogICAgICAidmlzaWJpbGl0eSIgOiAiUFVCTElDIiwKICAgICAgInBhdGgiIDogIi8wMDAwLTAwMDMtMTQxOS0yNDA1L2V4dGVybmFsLWlkZW50aWZpZXJzLzE4Mjc3OCIsCiAgICAgICJwdXQtY29kZSIgOiAxODI3NzgsCiAgICAgICJkaXNwbGF5LWluZGV4IiA6IDIKICAgIH0sIHsKICAgICAgImNyZWF0ZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0OTc5NzI3ODk0NDgKICAgICAgfSwKICAgICAgImxhc3QtbW9kaWZpZWQtZGF0ZSIgOiB7CiAgICAgICAgInZhbHVlIiA6IDE0OTc5NzI3ODk0NDgKICAgICAgfSwKICAgICAgInNvdXJjZSIgOiB7CiAgICAgICAgInNvdXJjZS1vcmNpZCIgOiBudWxsLAogICAgICAgICJzb3VyY2UtY2xpZW50LWlkIiA6IHsKICAgICAgICAgICJ1cmkiIDogImh0dHBzOi8vb3JjaWQub3JnL2NsaWVudC8wMDAwLTAwMDEtODA5OS02OTg0IiwKICAgICAgICAgICJwYXRoIiA6ICIwMDAwLTAwMDEtODA5OS02OTg0IiwKICAgICAgICAgICJob3N0IiA6ICJvcmNpZC5vcmciCiAgICAgICAgfSwKICAgICAgICAic291cmNlLW5hbWUiIDogewogICAgICAgICAgInZhbHVlIiA6ICJEYXRhQ2l0ZSIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJleHRlcm5hbC1pZC10eXBlIiA6ICJHaXRIdWIiLAogICAgICAiZXh0ZXJuYWwtaWQtdmFsdWUiIDogIm1mZW5uZXIiLAogICAgICAiZXh0ZXJuYWwtaWQtdXJsIiA6IHsKICAgICAgICAidmFsdWUiIDogImh0dHBzOi8vZ2l0aHViLmNvbS9tZmVubmVyIgogICAgICB9LAogICAgICAiZXh0ZXJuYWwtaWQtcmVsYXRpb25zaGlwIiA6ICJTRUxGIiwKICAgICAgInZpc2liaWxpdHkiIDogIlBVQkxJQyIsCiAgICAgICJwYXRoIiA6ICIvMDAwMC0wMDAzLTE0MTktMjQwNS9leHRlcm5hbC1pZGVudGlmaWVycy83Mzc1NDkiLAogICAgICAicHV0LWNvZGUiIDogNzM3NTQ5LAogICAgICAiZGlzcGxheS1pbmRleCIgOiAwCiAgICB9IF0sCiAgICAicGF0aCIgOiAiLzAwMDAtMDAwMy0xNDE5LTI0MDUvZXh0ZXJuYWwtaWRlbnRpZmllcnMiCiAgfSwKICAicGF0aCIgOiAiLzAwMDAtMDAwMy0xNDE5LTI0MDUvcGVyc29uIgp9 http_version: - recorded_at: Sun, 05 May 2019 10:30:03 GMT + recorded_at: Tue, 07 May 2019 19:04:30 GMT recorded_with: VCR 3.0.3 diff --git a/spec/fixtures/vcr_cassettes/Researcher/find_by_id/not_found.yml b/spec/fixtures/vcr_cassettes/Researcher/find_by_id/not_found.yml index aa75eaa46..87d338061 100644 --- a/spec/fixtures/vcr_cassettes/Researcher/find_by_id/not_found.yml +++ b/spec/fixtures/vcr_cassettes/Researcher/find_by_id/not_found.yml @@ -23,7 +23,7 @@ http_interactions: Content-Type: - application/vnd.orcid+json; qs=4;charset=UTF-8 Date: - - Sun, 05 May 2019 10:25:09 GMT + - Tue, 07 May 2019 19:04:30 GMT Expires: - '0' Pragma: @@ -37,7 +37,7 @@ http_interactions: Connection: - keep-alive Set-Cookie: - - X-Mapping-fjhppofk=AC7FD72D56BC49A75A07C0057E9FFEE4; path=/ + - X-Mapping-fjhppofk=FAC9A421C8E47CC7F8C08879007190C1; path=/ X-Frame-Options: - DENY body: @@ -51,5 +51,5 @@ http_interactions: "more-info" : "https://members.orcid.org/api/resources/troubleshooting" } http_version: - recorded_at: Sun, 05 May 2019 10:25:09 GMT + recorded_at: Tue, 07 May 2019 19:04:30 GMT recorded_with: VCR 3.0.3 diff --git a/spec/models/researcher_spec.rb b/spec/models/researcher_spec.rb index 91d2cba61..5a273aeaa 100644 --- a/spec/models/researcher_spec.rb +++ b/spec/models/researcher_spec.rb @@ -6,7 +6,7 @@ id = "https://orcid.org/0000-0003-1419-2405" researchers = Researcher.find_by_id(id) expect(researchers.size).to eq(1) - expect(researchers.first).to eq(id: "https://orcid.org/0000-0003-1419-2405", name: "Martin Fenner", given_name: "Martin", family_name: "Fenner") + expect(researchers.first).to eq(id: "https://orcid.org/0000-0003-1419-2405", name: "Martin Fenner", "givenName" => "Martin", "familyName" => "Fenner") end it "not found" do