Commit d6e64fd9 authored by Alper Akgun's avatar Alper Akgun

Expose trial_ends_on on Namespaces API

parent 80dd64cb
---
title: Add trial_ends_on to Namespaces API
merge_request: 22121
author:
type: added
...@@ -156,6 +156,9 @@ module EE ...@@ -156,6 +156,9 @@ module EE
expose :plan, if: ->(namespace, opts) { ::Ability.allowed?(opts[:current_user], :admin_namespace, namespace) } do |namespace, _| expose :plan, if: ->(namespace, opts) { ::Ability.allowed?(opts[:current_user], :admin_namespace, namespace) } do |namespace, _|
namespace.actual_plan_name namespace.actual_plan_name
end end
expose :trial_ends_on, if: ->(namespace, opts) { ::Ability.allowed?(opts[:current_user], :admin_namespace, namespace) } do |namespace, _|
namespace.trial_ends_on
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', 'avatar_url', 'web_url', 'trial_ends_on',
'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', 'avatar_url', 'web_url', 'trial_ends_on',
'extra_shared_runners_minutes_limit', 'billable_members_count') 'extra_shared_runners_minutes_limit', 'billable_members_count')
end end
end end
...@@ -40,7 +40,7 @@ describe API::Namespaces do ...@@ -40,7 +40,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', 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',
'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