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
bbb67df4
Commit
bbb67df4
authored
Jun 12, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Treat licenses with no plan specified as EES
parent
a69be90a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
app/models/license.rb
app/models/license.rb
+1
-1
spec/models/license_spec.rb
spec/models/license_spec.rb
+14
-0
spec/requests/api/license_spec.rb
spec/requests/api/license_spec.rb
+1
-1
No files found.
app/models/license.rb
View file @
bbb67df4
...
...
@@ -187,7 +187,7 @@ class License < ActiveRecord::Base
end
def
plan
restricted_attr
(
:plan
)
restricted_attr
(
:plan
,
STARTER_PLAN
)
end
def
current_active_users_count
...
...
spec/models/license_spec.rb
View file @
bbb67df4
...
...
@@ -344,6 +344,20 @@ describe License do
end
describe
'reading add-ons'
do
describe
'#plan'
do
it
'interprets no plan as EES'
do
license
=
build
(
:license
,
data:
build
(
:gitlab_license
,
restrictions:
{
add_ons:
{}
}).
export
)
expect
(
license
.
plan
).
to
eq
(
License
::
STARTER_PLAN
)
end
it
'interprets an unknown plan as unknown'
do
license
=
build_license_with_add_ons
({},
plan:
'unknown'
)
expect
(
license
.
plan
).
to
eq
(
'unknown'
)
end
end
describe
'#add_ons'
do
context
'without add-ons'
do
it
'returns an empty Hash'
do
...
...
spec/requests/api/license_spec.rb
View file @
bbb67df4
...
...
@@ -17,7 +17,7 @@ describe API::License, api: true do
expect
(
Date
.
parse
(
json_response
[
'expires_at'
])).
to
eq
Date
.
today
+
11
.
months
expect
(
json_response
[
'active_users'
]).
to
eq
1
expect
(
json_response
[
'licensee'
]).
not_to
be_empty
expect
(
json_response
[
'add_ons'
]).
to
eq
(
{
'GitLab_FileLocks'
=>
1
,
'GitLab_Auditor_User'
=>
1
}
)
expect
(
json_response
[
'add_ons'
]).
to
eq
(
license
.
add_ons
)
end
it
'denies access if not admin'
do
...
...
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