Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
760a2522
Commit
760a2522
authored
Jun 03, 2020
by
jejacks0n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes seat count defaults to avoid data loss
parent
801aaacd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
ee/lib/ee/api/namespaces.rb
ee/lib/ee/api/namespaces.rb
+2
-2
ee/spec/requests/api/namespaces_spec.rb
ee/spec/requests/api/namespaces_spec.rb
+15
-2
No files found.
ee/lib/ee/api/namespaces.rb
View file @
760a2522
...
...
@@ -36,8 +36,8 @@ module EE
resource
:namespaces
,
requirements:
::
API
::
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
helpers
do
params
:gitlab_subscription_optional_attributes
do
optional
:seats
,
type:
Integer
,
de
fault:
0
,
de
sc:
'The number of seats purchased'
optional
:max_seats_used
,
type:
Integer
,
de
fault:
0
,
de
sc:
'The max number of active users detected in the last month'
optional
:seats
,
type:
Integer
,
desc:
'The number of seats purchased'
optional
:max_seats_used
,
type:
Integer
,
desc:
'The max number of active users detected in the last month'
optional
:plan_code
,
type:
String
,
desc:
'The code of the purchased plan'
optional
:end_date
,
type:
Date
,
desc:
'The date when subscription expires'
optional
:auto_renew
,
type:
Grape
::
API
::
Boolean
,
desc:
'Whether the subscription auto renews'
...
...
ee/spec/requests/api/namespaces_spec.rb
View file @
760a2522
...
...
@@ -342,14 +342,27 @@ describe API::Namespaces do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
gitlab_subscription
.
reload
.
seats
).
to
eq
(
150
)
expect
(
gitlab_subscription
.
max_seats_used
).
to
eq
(
0
)
expect
(
gitlab_subscription
.
plan_name
).
to
eq
(
'silver'
)
expect
(
gitlab_subscription
.
plan_title
).
to
eq
(
'Silver'
)
end
it
'is sucessful using full_path when namespace path contains dots'
do
put
api
(
"/namespaces/
#{
namespace
.
full_path
}
/gitlab_subscription"
,
admin
),
params:
params
it
'is successful using full_path when namespace path contains dots'
do
do_put
(
namespace
.
id
,
admin
,
params
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
it
'does not clear out existing data because of defaults'
do
gitlab_subscription
.
update!
(
seats:
20
,
max_seats_used:
42
)
do_put
(
namespace
.
id
,
admin
,
params
.
except
(
:seats
))
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
gitlab_subscription
.
reload
).
to
have_attributes
(
seats:
20
,
max_seats_used:
42
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment