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
ca818ab6
Commit
ca818ab6
authored
Feb 05, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor spec
parent
09472f02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
26 deletions
+4
-26
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
+4
-26
No files found.
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
View file @
ca818ab6
...
...
@@ -8,38 +8,16 @@ describe Gitlab::Metrics::MultiFileEditor do
before
do
stub_licensed_features
(
ide:
true
)
allow
(
Digest
::
SHA256
).
to
receive
(
:hexdigest
).
and_return
(
'abcd'
)
end
describe
'.record'
do
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 log info'
do
info
=
"Web editor usage - ide_usage_project_id:
#{
project
.
id
}
, ide_usage_user:
#{
user
.
id
}
, ide_usage_line_count: 1, ide_usage_file_count: 1"
it
'has the right user'
do
expect
(
WebIdeMetric
.
first
.
user
).
to
eq
(
'abcd'
)
end
it
'has the right line count'
do
expect
(
WebIdeMetric
.
first
.
line_count
).
to
eq
(
1
)
end
it
'has the right file count'
do
expect
(
WebIdeMetric
.
first
.
file_count
).
to
eq
(
1
)
end
expect
(
Rails
.
logger
).
to
receive
(
:info
).
with
(
info
)
it
'has the created at timestamp'
do
expect
(
WebIdeMetric
.
first
.
created_at
).
to
be_a
(
Time
)
subject
.
log
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