summaryrefslogtreecommitdiff
path: root/spec/support/helpers/harbor_helper.rb
blob: 3f13710ede6dde0ed96d9db93664a0c808b26136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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