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
3d005033
Commit
3d005033
authored
8 years ago
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed and added missing scenario to events integration spec
parent
2e5c1c27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
spec/requests/projects/cycle_analytics_events_spec.rb
spec/requests/projects/cycle_analytics_events_spec.rb
+26
-14
No files found.
spec/requests/projects/cycle_analytics_events_spec.rb
View file @
3d005033
...
...
@@ -17,17 +17,17 @@ describe 'cycle analytics events' do
it
'lists the issue events'
do
get
namespace_project_cycle_analytics_issue_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
first_issue_iid
=
Issue
.
order
(
created_at: :desc
).
pluck
(
:iid
).
first
.
to_s
expect
(
json_response
[
'
item
s'
].
first
[
'iid'
]).
to
eq
(
first_issue_iid
)
expect
(
json_response
[
'
event
s'
].
first
[
'iid'
]).
to
eq
(
first_issue_iid
)
end
it
'lists the plan events'
do
get
namespace_project_cycle_analytics_plan_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
commits
=
[]
...
...
@@ -39,53 +39,65 @@ describe 'cycle analytics events' do
newest_sha
=
commits
.
sort_by
{
|
k
|
k
[
'date'
]
}.
first
[
:sha
][
0
...
8
]
expect
(
json_response
[
'
item
s'
].
first
[
'sha'
]).
to
eq
(
newest_sha
)
expect
(
json_response
[
'
event
s'
].
first
[
'sha'
]).
to
eq
(
newest_sha
)
end
it
'lists the code events'
do
get
namespace_project_cycle_analytics_code_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
first_mr_iid
=
Issue
.
order
(
created_at: :desc
).
pluck
(
:iid
).
first
.
to_s
expect
(
json_response
[
'
item
s'
].
first
[
'iid'
]).
to
eq
(
first_mr_iid
)
expect
(
json_response
[
'
event
s'
].
first
[
'iid'
]).
to
eq
(
first_mr_iid
)
end
it
'lists the test events'
do
get
namespace_project_cycle_analytics_test_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
expect
(
json_response
[
'
item
s'
].
first
[
'date'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
].
first
[
'date'
]).
not_to
be_empty
end
it
'lists the review events'
do
get
namespace_project_cycle_analytics_review_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
first_mr_iid
=
Issue
.
order
(
created_at: :desc
).
pluck
(
:iid
).
first
.
to_s
expect
(
json_response
[
'
item
s'
].
first
[
'iid'
]).
to
eq
(
first_mr_iid
)
expect
(
json_response
[
'
event
s'
].
first
[
'iid'
]).
to
eq
(
first_mr_iid
)
end
it
'lists the staging events'
do
get
namespace_project_cycle_analytics_staging_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
expect
(
json_response
[
'
item
s'
].
first
[
'date'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
].
first
[
'date'
]).
not_to
be_empty
end
it
'lists the production events'
do
get
namespace_project_cycle_analytics_production_path
(
project
.
namespace
,
project
,
format: :json
)
expect
(
json_response
[
'
item
s'
]).
not_to
be_empty
expect
(
json_response
[
'
event
s'
]).
not_to
be_empty
first_issue_iid
=
Issue
.
order
(
created_at: :desc
).
pluck
(
:iid
).
first
.
to_s
expect
(
json_response
[
'items'
].
first
[
'iid'
]).
to
eq
(
first_issue_iid
)
expect
(
json_response
[
'events'
].
first
[
'iid'
]).
to
eq
(
first_issue_iid
)
end
context
'specific branch'
do
it
'lists the test events'
do
branch
=
MergeRequest
.
first
.
source_branch
get
namespace_project_cycle_analytics_test_path
(
project
.
namespace
,
project
,
format: :json
,
branch:
branch
)
expect
(
json_response
[
'events'
]).
not_to
be_empty
expect
(
json_response
[
'events'
].
first
[
'date'
]).
not_to
be_empty
end
end
end
...
...
This diff is collapsed.
Click to expand it.
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