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
Léo-Paul Géneau
gitlab-ce
Commits
daa4f3de
Commit
daa4f3de
authored
Dec 01, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec failures after merge
parent
58dddcdf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
9 deletions
+14
-9
spec/lib/gitlab/cycle_analytics/plan_event_spec.rb
spec/lib/gitlab/cycle_analytics/plan_event_spec.rb
+1
-1
spec/lib/gitlab/cycle_analytics/shared_event_spec.rb
spec/lib/gitlab/cycle_analytics/shared_event_spec.rb
+1
-1
spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb
spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb
+3
-3
spec/serializers/analytics_stage_serializer_spec.rb
spec/serializers/analytics_stage_serializer_spec.rb
+2
-2
spec/serializers/analytics_summary_serializer_spec.rb
spec/serializers/analytics_summary_serializer_spec.rb
+7
-2
No files found.
spec/lib/gitlab/cycle_analytics/plan_event_spec.rb
View file @
daa4f3de
...
...
@@ -11,7 +11,7 @@ describe Gitlab::CycleAnalytics::PlanEvent do
context
'no commits'
do
it
'does not blow up if there are no commits'
do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
EventsQuery
).
to
receive
(
:execute
).
and_return
([{}])
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
MetricsFetcher
).
to
receive
(
:events
).
and_return
([{}])
expect
{
event
.
fetch
}.
not_to
raise_error
end
...
...
spec/lib/gitlab/cycle_analytics/shared_event_spec.rb
View file @
daa4f3de
...
...
@@ -7,7 +7,7 @@ shared_examples 'default query config' do
branch:
nil
)
end
let
(
:event
)
{
described_class
.
new
(
fetcher:
fetcher
,
stage:
stage_name
,
options:
{})
}
let
(
:event
)
{
described_class
.
new
(
fetcher:
fetcher
,
options:
{})
}
it
'has the start attributes'
do
expect
(
event
.
start_time_attrs
).
not_to
be_nil
...
...
spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb
View file @
daa4f3de
require
'spec_helper'
shared_examples
'base stage'
do
let
(
:stage
)
{
described_class
.
new
(
project:
double
,
options:
{}
,
stage:
stage_name
)
}
let
(
:stage
)
{
described_class
.
new
(
project:
double
,
options:
{})
}
before
do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
MetricsFetcher
).
to
receive
(
:median
).
and_return
(
1.12
)
...
...
@@ -20,8 +20,8 @@ shared_examples 'base stage' do
expect
(
stage
.
median_data
[
:description
]).
not_to
be_nil
end
it
'has the
stag
e'
do
expect
(
stage
.
stage
).
to
eq
(
stage_nam
e
)
it
'has the
titl
e'
do
expect
(
stage
.
title
).
to
eq
(
stage_name
.
to_s
.
capitaliz
e
)
end
it
'has the events'
do
...
...
spec/serializers/analytics_stage_serializer_spec.rb
View file @
daa4f3de
...
...
@@ -7,7 +7,7 @@ describe AnalyticsStageSerializer do
end
let
(
:json
)
{
serializer
.
as_json
}
let
(
:resource
)
{
Gitlab
::
CycleAnalytics
::
CodeStage
.
new
(
project:
double
,
options:
{}
,
stage: :code
)
}
let
(
:resource
)
{
Gitlab
::
CycleAnalytics
::
CodeStage
.
new
(
project:
double
,
options:
{})
}
before
do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
MetricsFetcher
).
to
receive
(
:median
).
and_return
(
1.12
)
...
...
@@ -15,7 +15,7 @@ describe AnalyticsStageSerializer do
end
it
'it generates payload for single object'
do
expect
(
json
).
to
be_
an_instance
_of
Hash
expect
(
json
).
to
be_
kind
_of
Hash
end
it
'contains important elements of AnalyticsStage'
do
...
...
spec/serializers/analytics_summary_serializer_spec.rb
View file @
daa4f3de
...
...
@@ -8,14 +8,19 @@ describe AnalyticsSummarySerializer do
let
(
:json
)
{
serializer
.
as_json
}
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:resource
)
{
Gitlab
::
CycleAnalytics
::
Summary
::
Issue
.
new
(
project:
double
,
from:
1
.
day
.
ago
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:resource
)
do
Gitlab
::
CycleAnalytics
::
Summary
::
Issue
.
new
(
project:
double
,
from:
1
.
day
.
ago
,
current_user:
user
)
end
before
do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
Summary
::
Issue
).
to
receive
(
:value
).
and_return
(
1.12
)
end
it
'it generates payload for single object'
do
expect
(
json
).
to
be_
an_instance
_of
Hash
expect
(
json
).
to
be_
kind
_of
Hash
end
it
'contains important elements of AnalyticsStage'
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