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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
e56c305b
Commit
e56c305b
authored
Nov 18, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec failures
parent
24c2aa39
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
64 additions
and
28 deletions
+64
-28
spec/lib/gitlab/cycle_analytics/code_event_spec.rb
spec/lib/gitlab/cycle_analytics/code_event_spec.rb
+4
-4
spec/lib/gitlab/cycle_analytics/issue_event_spec.rb
spec/lib/gitlab/cycle_analytics/issue_event_spec.rb
+4
-4
spec/lib/gitlab/cycle_analytics/plan_event_spec.rb
spec/lib/gitlab/cycle_analytics/plan_event_spec.rb
+4
-4
spec/lib/gitlab/cycle_analytics/production_event_spec.rb
spec/lib/gitlab/cycle_analytics/production_event_spec.rb
+1
-1
spec/lib/gitlab/cycle_analytics/review_event_spec.rb
spec/lib/gitlab/cycle_analytics/review_event_spec.rb
+1
-1
spec/lib/gitlab/cycle_analytics/shared_event_spec.rb
spec/lib/gitlab/cycle_analytics/shared_event_spec.rb
+6
-4
spec/lib/gitlab/cycle_analytics/staging_event_spec.rb
spec/lib/gitlab/cycle_analytics/staging_event_spec.rb
+4
-4
spec/lib/gitlab/cycle_analytics/test_event_spec.rb
spec/lib/gitlab/cycle_analytics/test_event_spec.rb
+4
-4
spec/serializers/analytics_issue_serializer_spec.rb
spec/serializers/analytics_issue_serializer_spec.rb
+2
-2
spec/serializers/analytics_merge_request_serializer_spec.rb
spec/serializers/analytics_merge_request_serializer_spec.rb
+34
-0
No files found.
spec/lib/gitlab/cycle_analytics/code_event_spec.rb
View file @
e56c305b
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
require
'lib/gitlab/cycle_analytics/shared_event_spec'
describe
Gitlab
::
CycleAnalytics
::
CodeEvent
do
it_behaves_like
'default query config'
it
'has the default order'
do
e
xpect
(
described_class
.
order
).
not_to
eq
(
described_class
.
start_time_attrs
)
it_behaves_like
'default query config'
do
it
'does not have the default order'
do
expect
(
event
.
order
).
not_to
eq
(
event
.
start_time_attrs
)
e
nd
end
end
spec/lib/gitlab/cycle_analytics/issue_event_spec.rb
View file @
e56c305b
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
require
'lib/gitlab/cycle_analytics/shared_event_spec'
describe
Gitlab
::
CycleAnalytics
::
IssueEvent
do
it_behaves_like
'default query config'
it
'has the default order'
do
e
xpect
(
described_class
.
order
).
to
eq
(
described_class
.
start_time_attrs
)
it_behaves_like
'default query config'
do
it
'has the default order'
do
expect
(
event
.
order
).
to
eq
(
event
.
start_time_attrs
)
e
nd
end
end
spec/lib/gitlab/cycle_analytics/plan_event_spec.rb
View file @
e56c305b
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
require
'lib/gitlab/cycle_analytics/shared_event_spec'
describe
Gitlab
::
CycleAnalytics
::
PlanEvent
do
it_behaves_like
'default query config'
it
'has the default order'
do
e
xpect
(
described_class
.
order
).
to
eq
(
described_class
.
start_time_attrs
)
it_behaves_like
'default query config'
do
it
'has the default order'
do
expect
(
event
.
order
).
to
eq
(
event
.
start_time_attrs
)
e
nd
end
end
spec/lib/gitlab/cycle_analytics/production_event_spec.rb
View file @
e56c305b
...
...
@@ -5,6 +5,6 @@ describe Gitlab::CycleAnalytics::ProductionEvent do
it_behaves_like
'default query config'
it
'has the default order'
do
expect
(
described_class
.
order
).
to
eq
(
described_class
.
start_time_attrs
)
expect
(
event
.
order
).
to
eq
(
event
.
start_time_attrs
)
end
end
spec/lib/gitlab/cycle_analytics/review_event_spec.rb
View file @
e56c305b
...
...
@@ -5,6 +5,6 @@ describe Gitlab::CycleAnalytics::ReviewEvent do
it_behaves_like
'default query config'
it
'has the default order'
do
expect
(
described_class
.
order
).
to
eq
(
described_class
.
start_time_attrs
)
expect
(
event
.
order
).
to
eq
(
event
.
start_time_attrs
)
end
end
spec/lib/gitlab/cycle_analytics/shared_event_spec.rb
View file @
e56c305b
require
'spec_helper'
shared_examples
'default query config'
do
let
(
:event
)
{
described_class
.
new
(
project:
double
,
options:
{})
}
it
'has the start attributes'
do
expect
(
described_class
.
start_time_attrs
).
not_to
be_nil
expect
(
event
.
start_time_attrs
).
not_to
be_nil
end
it
'has the stage attribute'
do
expect
(
described_class
.
stage
).
not_to
be_nil
expect
(
event
.
stage
).
not_to
be_nil
end
it
'has the end attributes'
do
expect
(
described_class
.
end_time_attrs
).
not_to
be_nil
expect
(
event
.
end_time_attrs
).
not_to
be_nil
end
it
'has the projection attributes'
do
expect
(
described_class
.
projections
).
not_to
be_nil
expect
(
event
.
projections
).
not_to
be_nil
end
end
spec/lib/gitlab/cycle_analytics/staging_event_spec.rb
View file @
e56c305b
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
require
'lib/gitlab/cycle_analytics/shared_event_spec'
describe
Gitlab
::
CycleAnalytics
::
StagingEvent
do
it_behaves_like
'default query config'
it
'has the default order'
do
e
xpect
(
described_class
.
order
).
not_to
eq
(
described_class
.
start_time_attrs
)
it_behaves_like
'default query config'
do
it
'does not have the default order'
do
expect
(
event
.
order
).
not_to
eq
(
event
.
start_time_attrs
)
e
nd
end
end
spec/lib/gitlab/cycle_analytics/test_event_spec.rb
View file @
e56c305b
...
...
@@ -2,9 +2,9 @@ require 'spec_helper'
require
'lib/gitlab/cycle_analytics/shared_event_spec'
describe
Gitlab
::
CycleAnalytics
::
TestEvent
do
it_behaves_like
'default query config'
it
'has the default order'
do
e
xpect
(
described_class
.
order
).
not_to
eq
(
described_class
.
start_time_attrs
)
it_behaves_like
'default query config'
do
it
'does not have the default order'
do
expect
(
event
.
order
).
not_to
eq
(
event
.
start_time_attrs
)
e
nd
end
end
spec/serializers/analytics_
generic
_serializer_spec.rb
→
spec/serializers/analytics_
issue
_serializer_spec.rb
View file @
e56c305b
require
'spec_helper'
describe
Analytics
Generic
Serializer
do
describe
Analytics
Issue
Serializer
do
let
(
:serializer
)
do
described_class
.
new
(
project:
project
,
entity: :merge_request
)
...
...
@@ -26,7 +26,7 @@ describe AnalyticsGenericSerializer do
expect
(
json
).
to
be_an_instance_of
Hash
end
it
'contains important elements of
analyticsBuild
'
do
it
'contains important elements of
the issue
'
do
expect
(
json
).
to
include
(
:title
,
:iid
,
:created_at
,
:total_time
,
:url
,
:author
)
end
end
...
...
spec/serializers/analytics_merge_request_serializer_spec.rb
0 → 100644
View file @
e56c305b
require
'spec_helper'
describe
AnalyticsMergeRequestSerializer
do
let
(
:serializer
)
do
described_class
.
new
(
project:
project
,
entity: :merge_request
)
.
represent
(
resource
)
end
let
(
:user
)
{
create
(
:user
)
}
let
(
:json
)
{
serializer
.
as_json
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:resource
)
do
{
total_time:
"172802.724419"
,
title:
"Eos voluptatem inventore in sed."
,
iid:
"1"
,
id:
"1"
,
state:
'open'
,
created_at:
"2016-11-12 15:04:02.948604"
,
author:
user
}
end
context
'when there is a single object provided'
do
it
'it generates payload for single object'
do
expect
(
json
).
to
be_an_instance_of
Hash
end
it
'contains important elements of the merge request'
do
expect
(
json
).
to
include
(
:title
,
:iid
,
:created_at
,
:total_time
,
:url
,
:author
,
:state
)
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