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/harbor_helper.rb')
-rw-r--r--spec/support/helpers/harbor_helper.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/support/helpers/harbor_helper.rb b/spec/support/helpers/harbor_helper.rb
new file mode 100644
index 00000000000..3f13710ede6
--- /dev/null
+++ b/spec/support/helpers/harbor_helper.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+module HarborHelper
+ def harbor_repository_url(container, *args)
+ if container.is_a?(Project)
+ project_harbor_repositories_path(container, *args)
+ else
+ group_harbor_repositories_path(container, *args)
+ end
+ end
+
+ def harbor_artifact_url(container, *args)
+ if container.is_a?(Project)
+ project_harbor_repository_artifacts_path(container, *args)
+ else
+ group_harbor_repository_artifacts_path(container, *args)
+ end
+ end
+
+ def harbor_tag_url(container, *args)
+ if container.is_a?(Project)
+ project_harbor_repository_artifact_tags_path(container, *args)
+ else
+ group_harbor_repository_artifact_tags_path(container, *args)
+ end
+ end
+end