From 567071eb0273db752f881edbb0b6fc71e0b58352 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 10 Apr 2020 12:47:47 +0200 Subject: [PATCH] fix person spec --- app/graphql/types/affiliation_type.rb | 4 ++-- spec/graphql/types/person_type_spec.rb | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/graphql/types/affiliation_type.rb b/app/graphql/types/affiliation_type.rb index 21ee1dacd..db6d7c255 100644 --- a/app/graphql/types/affiliation_type.rb +++ b/app/graphql/types/affiliation_type.rb @@ -3,6 +3,6 @@ class AffiliationType < BaseObject description "Information about affiliations" - field :id, ID, null: true, description: "Unique identifier for each affiliation" - field :name, String, null: true, description: "Affiliation name" + field :id, ID, null: true, description: "Affiliation ROR identifier" + field :name, String, null: false, description: "Affiliation name" end diff --git a/spec/graphql/types/person_type_spec.rb b/spec/graphql/types/person_type_spec.rb index b45760fec..26dc6ba56 100644 --- a/spec/graphql/types/person_type_spec.rb +++ b/spec/graphql/types/person_type_spec.rb @@ -100,6 +100,9 @@ name givenName familyName + affiliation { + name + } works { totalCount years { @@ -120,6 +123,10 @@ person = response.dig("data", "people", "nodes", 0) expect(person.fetch("id")).to eq("https://orcid.org/0000-0002-6028-9323") expect(person.fetch("name")).to eq("Stephen A. Fenner") + expect(person.fetch("affiliation")).to eq([{"name"=>"Harvard College"}, + {"name"=>"University of Chicago"}, + {"name"=>"University of South Carolina"}, + {"name"=>"University of Southern Maine"}]) end end end