Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/graphql_helpers.rb')
-rw-r--r--spec/support/helpers/graphql_helpers.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb
index 35c298a4d48..013a870796c 100644
--- a/spec/support/helpers/graphql_helpers.rb
+++ b/spec/support/helpers/graphql_helpers.rb
@@ -510,8 +510,12 @@ module GraphqlHelpers
end
end
- def global_id_of(model)
- model.to_global_id.to_s
+ def global_id_of(model, id: nil, model_name: nil)
+ if id || model_name
+ ::Gitlab::GlobalId.build(model, id: id, model_name: model_name).to_s
+ else
+ model.to_global_id.to_s
+ end
end
def missing_required_argument(path, argument)