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
682e354d
Commit
682e354d
authored
Feb 06, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add spec
parent
1b7c1867
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb
+44
-0
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