Commit bc32d9f4 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'aa-add-trial-field-to-namespaces-api' into 'master'

Add trial field to namespaces API

See merge request gitlab-org/gitlab!24666
parents 76c340aa 85adbf85
---
title: Add trial field to namespaces API
merge_request: 24666
author:
type: added
...@@ -170,6 +170,9 @@ module EE ...@@ -170,6 +170,9 @@ module EE
expose :trial_ends_on, if: can_admin_namespace do |namespace, _| expose :trial_ends_on, if: can_admin_namespace do |namespace, _|
namespace.trial_ends_on namespace.trial_ends_on
end end
expose :trial, if: can_admin_namespace do |namespace, _|
namespace.trial?
end
end end
end end
......
...@@ -22,12 +22,12 @@ describe API::Namespaces do ...@@ -22,12 +22,12 @@ describe API::Namespaces do
expect(group_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', expect(group_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path',
'parent_id', 'members_count_with_descendants', 'parent_id', 'members_count_with_descendants',
'plan', 'shared_runners_minutes_limit', 'plan', 'shared_runners_minutes_limit',
'avatar_url', 'web_url', 'trial_ends_on', 'avatar_url', 'web_url', 'trial_ends_on', 'trial',
'extra_shared_runners_minutes_limit', 'billable_members_count') 'extra_shared_runners_minutes_limit', 'billable_members_count')
expect(user_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', expect(user_kind_json_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path',
'parent_id', 'plan', 'shared_runners_minutes_limit', 'parent_id', 'plan', 'shared_runners_minutes_limit',
'avatar_url', 'web_url', 'trial_ends_on', 'avatar_url', 'web_url', 'trial_ends_on', 'trial',
'extra_shared_runners_minutes_limit', 'billable_members_count') 'extra_shared_runners_minutes_limit', 'billable_members_count')
end end
end end
...@@ -41,7 +41,7 @@ describe API::Namespaces do ...@@ -41,7 +41,7 @@ describe API::Namespaces do
owned_group_response = json_response.find { |resource| resource['id'] == group1.id } owned_group_response = json_response.find { |resource| resource['id'] == group1.id }
expect(owned_group_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', 'trial_ends_on', expect(owned_group_response.keys).to contain_exactly('id', 'kind', 'name', 'path', 'full_path', 'trial_ends_on',
'plan', 'parent_id', 'members_count_with_descendants', 'plan', 'parent_id', 'members_count_with_descendants', 'trial',
'avatar_url', 'web_url', 'billable_members_count') 'avatar_url', 'web_url', 'billable_members_count')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment