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
dc3a6f1e
Commit
dc3a6f1e
authored
Jan 31, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update spec to use DB and not Metrics
parent
1a05fb40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
+24
-16
No files found.
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
View file @
dc3a6f1e
...
...
@@ -3,32 +3,40 @@ require 'spec_helper'
describe
Gitlab
::
Metrics
::
MultiFileEditor
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:params
)
do
[
:multi_file_editor_usage
,
'Total number of commits using the multi-file web editor'
,
{
project:
'abcd'
,
user:
'abcd'
,
line_changes:
1
,
files_count:
1
}
]
end
subject
{
described_class
.
new
(
project
,
user
,
project
.
repository
.
commit
(
'HEAD'
))
}
before
do
stub_licensed_features
(
ide:
true
)
allow
(
Digest
::
SHA256
).
to
receive
(
:hexdigest
).
and_return
(
'abcd'
)
end
describe
'.record'
do
it
'records the right metrics'
do
stub_licensed_features
(
ide:
true
)
it
'records the metrics'
do
expect
{
subject
.
record
}.
to
change
{
WebIdeMetric
.
count
}.
from
(
0
).
to
(
1
)
end
describe
'metrics'
do
before
do
subject
.
record
end
it
'has the right project'
do
expect
(
WebIdeMetric
.
first
.
project
).
to
eq
(
'abcd'
)
end
it
'has the right user'
do
expect
(
WebIdeMetric
.
first
.
user
).
to
eq
(
'abcd'
)
end
expect
(
::
Gitlab
::
Metrics
).
to
receive
(
:counter
).
with
(
*
params
)
it
'has the right line count'
do
expect
(
WebIdeMetric
.
first
.
line_count
).
to
eq
(
1
)
end
subject
.
record
it
'has the right file count'
do
expect
(
WebIdeMetric
.
first
.
file_count
).
to
eq
(
1
)
end
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