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
682e354d
Commit
682e354d
authored
Feb 06, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add spec
parent
1b7c1867
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
base_event_fetcher_spec.rb
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
+18
-9
No files found.
spec/lib/gitlab/cycle_analytics/
events_query
_spec.rb
→
spec/lib/gitlab/cycle_analytics/
base_event_fetcher
_spec.rb
View file @
682e354d
require
'spec_helper'
describe
Gitlab
::
CycleAnalytics
::
EventsQuery
do
let
(
:max_events
)
{
3
}
describe
Gitlab
::
CycleAnalytics
::
BaseEventFetcher
do
let
(
:max_events
)
{
2
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:options
)
{
{
from:
30
.
days
.
ago
}
}
let
(
:start_time_attrs
)
{
Issue
.
arel_table
[
:created_at
]
}
let
(
:end_time_attrs
)
{
[
Issue
::
Metrics
.
arel_table
[
:first_associated_with_milestone_at
]]
}
let
(
:options
)
{
{
start_time_attrs:
start_time_attrs
,
end_time_attrs:
end_time_attrs
,
from:
30
.
days
.
ago
}
}
let
(
:issue_event
)
do
Gitlab
::
CycleAnalytics
::
IssueEvent
.
new
(
project:
project
,
options:
options
)
end
subject
{
described_class
.
new
(
project:
project
,
options:
options
).
execute
(
issue_event
)
}
subject
do
described_class
.
new
(
project:
project
,
stage: :issue
,
options:
options
).
fetch
end
before
do
allow_any_instance_of
(
Gitlab
::
ReferenceExtractor
).
to
receive
(
:issues
).
and_return
(
Issue
.
all
)
stub_const
(
'Gitlab::CycleAnalytics::EventsQuery::MAX_EVENTS'
,
max_events
)
allow_any_instance_of
(
Gitlab
::
CycleAnalytics
::
BaseEventFetcher
).
to
receive
(
:serialize
)
do
|
event
|
event
end
stub_const
(
'Gitlab::CycleAnalytics::BaseEventFetcher::MAX_EVENTS'
,
max_events
)
setup_events
(
count:
5
)
setup_events
(
count:
3
)
end
it
'limits the rows to the max number'
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