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
fe9c9415
Commit
fe9c9415
authored
May 05, 2017
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if license exists before checking the addon.
parent
e87728dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+3
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+6
-0
No files found.
lib/gitlab/usage_data.rb
View file @
fe9c9415
...
@@ -54,7 +54,9 @@ module Gitlab
...
@@ -54,7 +54,9 @@ module Gitlab
end
end
def
service_desk_counts
def
service_desk_counts
return
{}
unless
::
License
.
current
.
add_on?
(
'GitLab_ServiceDesk'
)
license
=
::
License
.
current
return
{}
if
license
.
nil?
return
{}
unless
license
.
add_on?
(
'GitLab_ServiceDesk'
)
projects_with_service_desk
=
Project
.
where
(
service_desk_enabled:
true
)
projects_with_service_desk
=
Project
.
where
(
service_desk_enabled:
true
)
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
fe9c9415
...
@@ -103,6 +103,12 @@ describe Gitlab::UsageData do
...
@@ -103,6 +103,12 @@ describe Gitlab::UsageData do
end
end
end
end
context
'when there is no license'
do
it
'returns an empty hash'
do
expect
(
subject
).
to
eq
({})
end
end
context
'when Service Desk is enabled'
do
context
'when Service Desk is enabled'
do
it
'gathers Service Desk data'
do
it
'gathers Service Desk data'
do
create_list
(
:issue
,
3
,
confidential:
true
,
author:
User
.
support_bot
,
project:
[
project3
,
project4
].
sample
)
create_list
(
:issue
,
3
,
confidential:
true
,
author:
User
.
support_bot
,
project:
[
project3
,
project4
].
sample
)
...
...
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