diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb b/spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb index 7e1f4500779..9033a8b4d3a 100644 --- a/spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/graphql/noteable_shared_examples.rb @@ -12,9 +12,9 @@ RSpec.shared_examples 'a noteable graphql type we can query' do def expected noteable.discussions.map do |discussion| - include( - 'id' => global_id_of(discussion), - 'replyId' => global_id_of(discussion, id: discussion.reply_id), + a_graphql_entity_for( + discussion, + 'replyId' => global_id_of(discussion, id: discussion.reply_id).to_s, 'createdAt' => discussion.created_at.iso8601, 'notes' => include( 'nodes' => have_attributes(size: discussion.notes.size) @@ -50,8 +50,8 @@ RSpec.shared_examples 'a noteable graphql type we can query' do post_graphql(query(fields), current_user: current_user) - data = graphql_data_at(*path_to_noteable, :discussions, :nodes, :noteable, :id) - expect(data[0]).to eq(global_id_of(noteable)) + entities = graphql_data_at(*path_to_noteable, :discussions, :nodes, :noteable) + expect(entities).to all(match(a_graphql_entity_for(noteable))) end end @@ -62,10 +62,10 @@ RSpec.shared_examples 'a noteable graphql type we can query' do def expected noteable.notes.map do |note| - include( - 'id' => global_id_of(note), - 'project' => include('id' => global_id_of(project)), - 'author' => include('id' => global_id_of(note.author)), + a_graphql_entity_for( + note, + 'project' => a_graphql_entity_for(project), + 'author' => a_graphql_entity_for(note.author), 'createdAt' => note.created_at.iso8601, 'body' => eq(note.note) ) |