BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e4e313fc
Commit
e4e313fc
authored
Nov 23, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix other spec failures
parent
a67311cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
stage_summary_spec.rb
spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb
+8
-8
analytics_summary_serializer_spec.rb
spec/serializers/analytics_summary_serializer_spec.rb
+2
-2
No files found.
spec/
models/cycle_analytics/
summary_spec.rb
→
spec/
lib/gitlab/cycle_analytics/stage_
summary_spec.rb
View file @
e4e313fc
...
...
@@ -4,20 +4,20 @@ describe Gitlab::CycleAnalytics::StageSummary, models: true do
let
(
:project
)
{
create
(
:project
)
}
let
(
:from
)
{
Time
.
now
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
subject
{
CycleAnalyticsTest
.
new
(
project
,
options:
{
from:
from_date
})
}
subject
{
described_class
.
new
(
project
,
from:
Time
.
now
).
data
}
describe
"#new_issues"
do
it
"finds the number of issues created after the 'from date'"
do
Timecop
.
freeze
(
5
.
days
.
ago
)
{
create
(
:issue
,
project:
project
)
}
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create
(
:issue
,
project:
project
)
}
expect
(
subject
.
new_issues
).
to
eq
(
1
)
expect
(
subject
.
first
[
:value
]
).
to
eq
(
1
)
end
it
"doesn't find issues from other projects"
do
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create
(
:issue
,
project:
create
(
:project
))
}
expect
(
subject
.
new_issues
).
to
eq
(
0
)
expect
(
subject
.
first
[
:value
]
).
to
eq
(
0
)
end
end
...
...
@@ -26,19 +26,19 @@ describe Gitlab::CycleAnalytics::StageSummary, models: true do
Timecop
.
freeze
(
5
.
days
.
ago
)
{
create_commit
(
"Test message"
,
project
,
user
,
'master'
)
}
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create_commit
(
"Test message"
,
project
,
user
,
'master'
)
}
expect
(
subject
.
commits
).
to
eq
(
1
)
expect
(
subject
.
second
[
:value
]
).
to
eq
(
1
)
end
it
"doesn't find commits from other projects"
do
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create_commit
(
"Test message"
,
create
(
:project
),
user
,
'master'
)
}
expect
(
subject
.
commits
).
to
eq
(
0
)
expect
(
subject
.
second
[
:value
]
).
to
eq
(
0
)
end
it
"finds a large (> 100) snumber of commits if present"
do
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create_commit
(
"Test message"
,
project
,
user
,
'master'
,
count:
100
)
}
expect
(
subject
.
commits
).
to
eq
(
100
)
expect
(
subject
.
second
[
:value
]
).
to
eq
(
100
)
end
end
...
...
@@ -47,13 +47,13 @@ describe Gitlab::CycleAnalytics::StageSummary, models: true do
Timecop
.
freeze
(
5
.
days
.
ago
)
{
create
(
:deployment
,
project:
project
)
}
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create
(
:deployment
,
project:
project
)
}
expect
(
subject
.
deploys
).
to
eq
(
1
)
expect
(
subject
.
third
[
:value
]
).
to
eq
(
1
)
end
it
"doesn't find commits from other projects"
do
Timecop
.
freeze
(
5
.
days
.
from_now
)
{
create
(
:deployment
,
project:
create
(
:project
))
}
expect
(
subject
.
deploys
).
to
eq
(
0
)
expect
(
subject
.
third
[
:value
]
).
to
eq
(
0
)
end
end
end
spec/serializers/analytics_summary_serializer_spec.rb
View file @
e4e313fc
...
...
@@ -8,10 +8,10 @@ describe AnalyticsSummarySerializer do
let
(
:json
)
{
serializer
.
as_json
}
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:resource
)
{
Gitlab
::
CycleAnalytics
::
S
tageS
ummary
::
Issue
.
new
(
project:
double
,
from:
1
.
day
.
ago
)
}
let
(
:resource
)
{
Gitlab
::
CycleAnalytics
::
Summary
::
Issue
.
new
(
project:
double
,
from:
1
.
day
.
ago
)
}
before
do
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
S
tageS
ummary
::
Issue
).
to
receive
(
:value
).
and_return
(
1.12
)
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
Summary
::
Issue
).
to
receive
(
:value
).
and_return
(
1.12
)
end
it
'it generates payload for single object'
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