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
387885e5
Commit
387885e5
authored
Feb 20, 2020
by
Vitali Tatarintev
Committed by
Heinrich Lee Yu
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set with let_it_be in spec/serializers
Removes usage of `set` in specs
parent
3dcccdce
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
22 additions
and
31 deletions
+22
-31
spec/serializers/build_details_entity_spec.rb
spec/serializers/build_details_entity_spec.rb
+1
-1
spec/serializers/container_repository_entity_spec.rb
spec/serializers/container_repository_entity_spec.rb
+4
-8
spec/serializers/container_tag_entity_spec.rb
spec/serializers/container_tag_entity_spec.rb
+4
-8
spec/serializers/deployment_serializer_spec.rb
spec/serializers/deployment_serializer_spec.rb
+2
-3
spec/serializers/merge_request_serializer_spec.rb
spec/serializers/merge_request_serializer_spec.rb
+2
-2
spec/serializers/namespace_basic_entity_spec.rb
spec/serializers/namespace_basic_entity_spec.rb
+1
-1
spec/serializers/pipeline_details_entity_spec.rb
spec/serializers/pipeline_details_entity_spec.rb
+1
-1
spec/serializers/pipeline_entity_spec.rb
spec/serializers/pipeline_entity_spec.rb
+3
-3
spec/serializers/pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+2
-2
spec/serializers/project_import_entity_spec.rb
spec/serializers/project_import_entity_spec.rb
+1
-1
spec/serializers/project_serializer_spec.rb
spec/serializers/project_serializer_spec.rb
+1
-1
No files found.
spec/serializers/build_details_entity_spec.rb
View file @
387885e5
...
@@ -5,7 +5,7 @@ require 'spec_helper'
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
BuildDetailsEntity
do
describe
BuildDetailsEntity
do
include
ProjectForksHelper
include
ProjectForksHelper
set
(
:user
)
{
create
(
:admin
)
}
let_it_be
(
:user
)
{
create
(
:admin
)
}
it
'inherits from JobEntity'
do
it
'inherits from JobEntity'
do
expect
(
described_class
).
to
be
<
JobEntity
expect
(
described_class
).
to
be
<
JobEntity
...
...
spec/serializers/container_repository_entity_spec.rb
View file @
387885e5
...
@@ -3,14 +3,10 @@
...
@@ -3,14 +3,10 @@
require
'spec_helper'
require
'spec_helper'
describe
ContainerRepositoryEntity
do
describe
ContainerRepositoryEntity
do
let
(
:entity
)
do
let_it_be
(
:project
)
{
create
(
:project
)
}
described_class
.
new
(
repository
,
request:
request
)
let_it_be
(
:user
)
{
create
(
:user
)
}
end
let_it_be
(
:repository
)
{
create
(
:container_repository
,
project:
project
)
}
let
(
:entity
)
{
described_class
.
new
(
repository
,
request:
request
)
}
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:repository
)
{
create
(
:container_repository
,
project:
project
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:request
)
{
double
(
'request'
)
}
subject
{
entity
.
as_json
}
subject
{
entity
.
as_json
}
...
...
spec/serializers/container_tag_entity_spec.rb
View file @
387885e5
...
@@ -3,14 +3,10 @@
...
@@ -3,14 +3,10 @@
require
'spec_helper'
require
'spec_helper'
describe
ContainerTagEntity
do
describe
ContainerTagEntity
do
let
(
:entity
)
do
let_it_be
(
:project
)
{
create
(
:project
)
}
described_class
.
new
(
tag
,
request:
request
)
let_it_be
(
:user
)
{
create
(
:user
)
}
end
let_it_be
(
:repository
)
{
create
(
:container_repository
,
name:
'image'
,
project:
project
)
}
let
(
:entity
)
{
described_class
.
new
(
tag
,
request:
request
)
}
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:repository
)
{
create
(
:container_repository
,
name:
'image'
,
project:
project
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:tag
)
{
repository
.
tag
(
'test'
)
}
let
(
:tag
)
{
repository
.
tag
(
'test'
)
}
...
...
spec/serializers/deployment_serializer_spec.rb
View file @
387885e5
...
@@ -3,9 +3,8 @@
...
@@ -3,9 +3,8 @@
require
'spec_helper'
require
'spec_helper'
describe
DeploymentSerializer
do
describe
DeploymentSerializer
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
,
email:
project
.
commit
.
author_email
)
}
let_it_be
(
:user
)
{
create
(
:user
,
email:
project
.
commit
.
author_email
)
}
let
(
:resource
)
{
create
(
:deployment
,
project:
project
,
sha:
project
.
commit
.
id
)
}
let
(
:resource
)
{
create
(
:deployment
,
project:
project
,
sha:
project
.
commit
.
id
)
}
let
(
:serializer
)
{
described_class
.
new
(
request
)
}
let
(
:serializer
)
{
described_class
.
new
(
request
)
}
...
...
spec/serializers/merge_request_serializer_spec.rb
View file @
387885e5
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
require
'spec_helper'
require
'spec_helper'
describe
MergeRequestSerializer
do
describe
MergeRequestSerializer
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
set
(
:resource
)
{
create
(
:merge_request
,
description:
"Description"
)
}
let_it_be
(
:resource
)
{
create
(
:merge_request
,
description:
"Description"
)
}
let
(
:json_entity
)
do
let
(
:json_entity
)
do
described_class
.
new
(
current_user:
user
)
described_class
.
new
(
current_user:
user
)
...
...
spec/serializers/namespace_basic_entity_spec.rb
View file @
387885e5
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
'spec_helper'
describe
NamespaceBasicEntity
do
describe
NamespaceBasicEntity
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:entity
)
do
let
(
:entity
)
do
described_class
.
represent
(
group
)
described_class
.
represent
(
group
)
end
end
...
...
spec/serializers/pipeline_details_entity_spec.rb
View file @
387885e5
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
'spec_helper'
describe
PipelineDetailsEntity
do
describe
PipelineDetailsEntity
do
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:request
)
{
double
(
'request'
)
}
it
'inherrits from PipelineEntity'
do
it
'inherrits from PipelineEntity'
do
...
...
spec/serializers/pipeline_entity_spec.rb
View file @
387885e5
...
@@ -5,9 +5,9 @@ require 'spec_helper'
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
PipelineEntity
do
describe
PipelineEntity
do
include
Gitlab
::
Routing
include
Gitlab
::
Routing
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:request
)
{
double
(
'request'
)
}
let
(
:request
)
{
double
(
'request'
)
}
before
do
before
do
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
387885e5
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
require
'spec_helper'
require
'spec_helper'
describe
PipelineSerializer
do
describe
PipelineSerializer
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:serializer
)
do
let
(
:serializer
)
do
described_class
.
new
(
current_user:
user
,
project:
project
)
described_class
.
new
(
current_user:
user
,
project:
project
)
...
...
spec/serializers/project_import_entity_spec.rb
View file @
387885e5
...
@@ -5,7 +5,7 @@ require 'spec_helper'
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
ProjectImportEntity
do
describe
ProjectImportEntity
do
include
ImportHelper
include
ImportHelper
set
(
:project
)
{
create
(
:project
,
import_status: :started
,
import_source:
'namespace/project'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
import_status: :started
,
import_source:
'namespace/project'
)
}
let
(
:provider_url
)
{
'https://provider.com'
}
let
(
:provider_url
)
{
'https://provider.com'
}
let
(
:entity
)
{
described_class
.
represent
(
project
,
provider_url:
provider_url
)
}
let
(
:entity
)
{
described_class
.
represent
(
project
,
provider_url:
provider_url
)
}
...
...
spec/serializers/project_serializer_spec.rb
View file @
387885e5
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
require
'spec_helper'
require
'spec_helper'
describe
ProjectSerializer
do
describe
ProjectSerializer
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:provider_url
)
{
'http://provider.com'
}
let
(
:provider_url
)
{
'http://provider.com'
}
context
'when serializer option is :import'
do
context
'when serializer option is :import'
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