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
e4ec603d
Commit
e4ec603d
authored
Aug 07, 2020
by
Jiaan Louw
Committed by
Mayra Cabrera
Aug 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor compliance entity spec using let_it_be
parent
adb328bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ee/spec/serializers/merge_request_compliance_entity_spec.rb
ee/spec/serializers/merge_request_compliance_entity_spec.rb
+5
-5
No files found.
ee/spec/serializers/merge_request_compliance_entity_spec.rb
View file @
e4ec603d
...
...
@@ -7,10 +7,10 @@ RSpec.describe MergeRequestComplianceEntity do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
state:
:merged
)
}
let
_it_be
(
:merge_request
)
{
create
(
:merge_request
,
:merged
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
,
project:
project
)
}
let
(
:entity
)
{
described_class
.
new
(
merge_request
,
request:
request
)
}
let
(
:entity
)
{
described_class
.
new
(
merge_request
.
reload
,
request:
request
)
}
describe
'.as_json'
do
subject
{
entity
.
as_json
}
...
...
@@ -35,9 +35,9 @@ RSpec.describe MergeRequestComplianceEntity do
describe
'with an approver'
do
let_it_be
(
:approver
)
{
create
(
:user
)
}
let
!
(
:approval
)
{
create
:approval
,
merge_request:
merge_request
,
user:
approver
}
let
_it_be
(
:approval
)
{
create
:approval
,
merge_request:
merge_request
,
user:
approver
}
before
do
before
_all
do
project
.
add_developer
(
approver
)
end
...
...
@@ -51,7 +51,7 @@ RSpec.describe MergeRequestComplianceEntity do
end
describe
'with a head pipeline'
do
let
!
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
status: :success
,
project:
project
,
head_pipeline_of:
merge_request
)
}
let
_it_be
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
status: :success
,
project:
project
,
head_pipeline_of:
merge_request
)
}
describe
'and the user cannot read the pipeline'
do
it
'does not include pipeline status attribute'
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