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 'qa/qa/resource/group_base.rb')
-rw-r--r--qa/qa/resource/group_base.rb47
1 files changed, 38 insertions, 9 deletions
diff --git a/qa/qa/resource/group_base.rb b/qa/qa/resource/group_base.rb
index bdd442a1c8b..025d98f50e0 100644
--- a/qa/qa/resource/group_base.rb
+++ b/qa/qa/resource/group_base.rb
@@ -14,6 +14,29 @@ module QA
attribute :name
attribute :full_path
+ # Get group labels
+ #
+ # @return [Array<QA::Resource::GroupLabel>]
+ def labels
+ parse_body(api_get_from("#{api_get_path}/labels")).map do |label|
+ GroupLabel.new.tap do |resource|
+ resource.api_client = api_client
+ resource.group = self
+ resource.id = label[:id]
+ resource.title = label[:name]
+ resource.description = label[:description]
+ resource.color = label[:color]
+ end
+ end
+ end
+
+ # API get path
+ #
+ # @return [String]
+ def api_get_path
+ raise NotImplementedError
+ end
+
# API post path
#
# @return [String]
@@ -58,15 +81,21 @@ module QA
def comparable_group
reload! if api_response.nil?
- api_resource.except(
- :id,
- :web_url,
- :visibility,
- :full_name,
- :full_path,
- :created_at,
- :parent_id,
- :runners_token
+ api_resource.slice(
+ :name,
+ :path,
+ :description,
+ :emails_disabled,
+ :lfs_enabled,
+ :mentions_disabled,
+ :project_creation_level,
+ :request_access_enabled,
+ :require_two_factor_authentication,
+ :share_with_group_lock,
+ :subgroup_creation_level,
+ :two_factor_grace_perion
+ # TODO: Add back visibility comparison once https://gitlab.com/gitlab-org/gitlab/-/issues/331252 is fixed
+ # :visibility
)
end
end