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
c4434c65
Commit
c4434c65
authored
Sep 22, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up pipeline presenter specs
parent
9e72553a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
spec/presenters/ci/pipeline_presenter_spec.rb
spec/presenters/ci/pipeline_presenter_spec.rb
+10
-7
No files found.
spec/presenters/ci/pipeline_presenter_spec.rb
View file @
c4434c65
...
...
@@ -5,17 +5,20 @@ require 'spec_helper'
RSpec
.
describe
Ci
::
PipelinePresenter
do
include
Gitlab
::
Routing
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be_with_reload
(
:project
)
{
create
(
:project
,
:test_repo
)
}
let_it_be_with_reload
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:current_user
)
{
user
}
let
(
:project
)
{
create
(
:project
,
:test_repo
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
subject
(
:presenter
)
do
described_class
.
new
(
pipeline
)
end
before
do
before
_all
do
project
.
add_developer
(
user
)
end
before
do
allow
(
presenter
).
to
receive
(
:current_user
)
{
current_user
}
end
...
...
@@ -184,8 +187,8 @@ RSpec.describe Ci::PipelinePresenter do
describe
'#all_related_merge_request_text'
do
subject
{
presenter
.
all_related_merge_request_text
}
let
(
:mr_1
)
{
create
(
:merge_request
)
}
let
(
:mr_2
)
{
create
(
:merge_request
)
}
let
_it_be
(
:mr_1
)
{
create
(
:merge_request
)
}
let
_it_be
(
:mr_2
)
{
create
(
:merge_request
)
}
context
'with zero related merge requests (branch pipeline)'
do
it
{
is_expected
.
to
eq
(
'No related merge requests found.'
)
}
...
...
@@ -242,7 +245,7 @@ RSpec.describe Ci::PipelinePresenter do
end
context
'permissions'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
:with_detached_merge_request_pipeline
,
source_project:
project
)
}
let
_it_be_with_refind
(
:merge_request
)
{
create
(
:merge_request
,
:with_detached_merge_request_pipeline
,
source_project:
project
)
}
let
(
:pipeline
)
{
merge_request
.
all_pipelines
.
take
}
shared_examples
'private merge requests'
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