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
Tatuya Kamada
gitlab-ce
Commits
f80ee373
Commit
f80ee373
authored
Dec 30, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve spec
parent
25d9f71e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
spec/features/cycle_analytics_spec.rb
spec/features/cycle_analytics_spec.rb
+9
-11
No files found.
spec/features/cycle_analytics_spec.rb
View file @
f80ee373
...
@@ -7,7 +7,10 @@ feature 'Cycle Analytics', feature: true, js: true do
...
@@ -7,7 +7,10 @@ feature 'Cycle Analytics', feature: true, js: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
created_at:
2
.
days
.
ago
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
created_at:
2
.
days
.
ago
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:mr
)
{
create_merge_request_closing_issue
(
issue
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
,
ref:
mr
.
source_branch
,
sha:
mr
.
source_branch_sha
)
}
context
'as an allowed user'
do
context
'as an allowed user'
do
context
'when project is new'
do
context
'when project is new'
do
...
@@ -44,7 +47,7 @@ feature 'Cycle Analytics', feature: true, js: true do
...
@@ -44,7 +47,7 @@ feature 'Cycle Analytics', feature: true, js: true do
expect_issue_to_be_present
expect_issue_to_be_present
click_stage
(
'Plan'
)
click_stage
(
'Plan'
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
@merge_request
.
commits
.
last
.
title
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
mr
.
commits
.
last
.
title
)
click_stage
(
'Code'
)
click_stage
(
'Code'
)
expect_merge_request_to_be_present
expect_merge_request_to_be_present
...
@@ -66,7 +69,6 @@ feature 'Cycle Analytics', feature: true, js: true do
...
@@ -66,7 +69,6 @@ feature 'Cycle Analytics', feature: true, js: true do
context
"as a guest"
do
context
"as a guest"
do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
allow_any_instance_of
(
Gitlab
::
ReferenceExtractor
).
to
receive
(
:issues
).
and_return
([
issue
])
allow_any_instance_of
(
Gitlab
::
ReferenceExtractor
).
to
receive
(
:issues
).
and_return
([
issue
])
...
@@ -102,23 +104,19 @@ feature 'Cycle Analytics', feature: true, js: true do
...
@@ -102,23 +104,19 @@ feature 'Cycle Analytics', feature: true, js: true do
end
end
def
expect_merge_request_to_be_present
def
expect_merge_request_to_be_present
expect
(
find
(
'.stage-events'
)).
to
have_content
(
@merge_request
.
title
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
mr
.
title
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
@merge_request
.
author
.
name
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
mr
.
author
.
name
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
"!
#{
@merge_request
.
iid
}
"
)
expect
(
find
(
'.stage-events'
)).
to
have_content
(
"!
#{
mr
.
iid
}
"
)
end
end
def
create_cycle
def
create_cycle
milestone
=
create
(
:milestone
,
project:
project
)
issue
.
update
(
milestone:
milestone
)
issue
.
update
(
milestone:
milestone
)
@merge_request
=
create_merge_request_closing_issue
(
issue
)
pipeline
=
create
(
:ci_empty_pipeline
,
status:
'created'
,
project:
project
,
ref:
@merge_request
.
source_branch
,
sha:
@merge_request
.
source_branch_sha
)
pipeline
.
run
pipeline
.
run
@build
=
create
(
:ci_build
,
pipeline:
pipeline
,
status: :success
,
author:
user
)
@build
=
create
(
:ci_build
,
pipeline:
pipeline
,
status: :success
,
author:
user
)
merge_merge_requests_closing_issue
(
issue
)
merge_merge_requests_closing_issue
(
issue
)
ProcessCommitWorker
.
new
.
perform
(
project
.
id
,
user
.
id
,
@merge_request
.
commits
.
last
.
to_hash
)
ProcessCommitWorker
.
new
.
perform
(
project
.
id
,
user
.
id
,
mr
.
commits
.
last
.
to_hash
)
end
end
def
click_stage
(
stage_name
)
def
click_stage
(
stage_name
)
...
...
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