Skip to content

Commit

Permalink
fix person spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 10, 2020
1 parent 5d51a6a commit 567071e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/graphql/types/affiliation_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions spec/graphql/types/person_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
name
givenName
familyName
affiliation {
name
}
works {
totalCount
years {
Expand All @@ -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

0 comments on commit 567071e

Please sign in to comment.