summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 03:08:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 03:08:49 +0000
commita8c82a6395ed62380b9061a26d92e41d46c2877e (patch)
treebd8ab49ac11104ad9ae953afd4c5e0036fdddaa2 /spec/serializers
parent0b881f91159cc97ccb7328a2e52977a60ea83fbe (diff)
downloadgitlab-ce-a8c82a6395ed62380b9061a26d92e41d46c2877e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/build_details_entity_spec.rb2
-rw-r--r--spec/serializers/container_repository_entity_spec.rb12
-rw-r--r--spec/serializers/container_tag_entity_spec.rb12
-rw-r--r--spec/serializers/deployment_serializer_spec.rb5
-rw-r--r--spec/serializers/merge_request_serializer_spec.rb4
-rw-r--r--spec/serializers/namespace_basic_entity_spec.rb2
-rw-r--r--spec/serializers/pipeline_details_entity_spec.rb2
-rw-r--r--spec/serializers/pipeline_entity_spec.rb6
-rw-r--r--spec/serializers/pipeline_serializer_spec.rb4
-rw-r--r--spec/serializers/project_import_entity_spec.rb2
-rw-r--r--spec/serializers/project_serializer_spec.rb2
11 files changed, 22 insertions, 31 deletions
diff --git a/spec/serializers/build_details_entity_spec.rb b/spec/serializers/build_details_entity_spec.rb
index fc05989df16..15f605b183d 100644
--- a/spec/serializers/build_details_entity_spec.rb
+++ b/spec/serializers/build_details_entity_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe BuildDetailsEntity do
include ProjectForksHelper
- set(:user) { create(:admin) }
+ let_it_be(:user) { create(:admin) }
it 'inherits from JobEntity' do
expect(described_class).to be < JobEntity
diff --git a/spec/serializers/container_repository_entity_spec.rb b/spec/serializers/container_repository_entity_spec.rb
index 799a8d5c122..96c80331f41 100644
--- a/spec/serializers/container_repository_entity_spec.rb
+++ b/spec/serializers/container_repository_entity_spec.rb
@@ -3,14 +3,10 @@
require 'spec_helper'
describe ContainerRepositoryEntity do
- let(:entity) do
- described_class.new(repository, request: request)
- end
-
- set(:project) { create(:project) }
- set(:user) { create(:user) }
- set(:repository) { create(:container_repository, project: project) }
-
+ let_it_be(:project) { create(:project) }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:repository) { create(:container_repository, project: project) }
+ let(:entity) { described_class.new(repository, request: request) }
let(:request) { double('request') }
subject { entity.as_json }
diff --git a/spec/serializers/container_tag_entity_spec.rb b/spec/serializers/container_tag_entity_spec.rb
index 8a67a189761..8440e56f08f 100644
--- a/spec/serializers/container_tag_entity_spec.rb
+++ b/spec/serializers/container_tag_entity_spec.rb
@@ -3,14 +3,10 @@
require 'spec_helper'
describe ContainerTagEntity do
- let(:entity) do
- described_class.new(tag, request: request)
- end
-
- set(:project) { create(:project) }
- set(:user) { create(:user) }
- set(:repository) { create(:container_repository, name: 'image', project: project) }
-
+ let_it_be(:project) { create(:project) }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:repository) { create(:container_repository, name: 'image', project: project) }
+ let(:entity) { described_class.new(tag, request: request) }
let(:request) { double('request') }
let(:tag) { repository.tag('test') }
diff --git a/spec/serializers/deployment_serializer_spec.rb b/spec/serializers/deployment_serializer_spec.rb
index 4834f5ede3c..67fccaa3f25 100644
--- a/spec/serializers/deployment_serializer_spec.rb
+++ b/spec/serializers/deployment_serializer_spec.rb
@@ -3,9 +3,8 @@
require 'spec_helper'
describe DeploymentSerializer do
- set(:project) { create(:project, :repository) }
- set(:user) { create(:user, email: project.commit.author_email) }
-
+ let_it_be(:project) { create(:project, :repository) }
+ let_it_be(:user) { create(:user, email: project.commit.author_email) }
let(:resource) { create(:deployment, project: project, sha: project.commit.id) }
let(:serializer) { described_class.new(request) }
diff --git a/spec/serializers/merge_request_serializer_spec.rb b/spec/serializers/merge_request_serializer_spec.rb
index 9297df31842..871a47b0a02 100644
--- a/spec/serializers/merge_request_serializer_spec.rb
+++ b/spec/serializers/merge_request_serializer_spec.rb
@@ -3,8 +3,8 @@
require 'spec_helper'
describe MergeRequestSerializer do
- set(:user) { create(:user) }
- set(:resource) { create(:merge_request, description: "Description") }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:resource) { create(:merge_request, description: "Description") }
let(:json_entity) do
described_class.new(current_user: user)
diff --git a/spec/serializers/namespace_basic_entity_spec.rb b/spec/serializers/namespace_basic_entity_spec.rb
index f8b71ceb9f3..d3d666d57aa 100644
--- a/spec/serializers/namespace_basic_entity_spec.rb
+++ b/spec/serializers/namespace_basic_entity_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
describe NamespaceBasicEntity do
- set(:group) { create(:group) }
+ let_it_be(:group) { create(:group) }
let(:entity) do
described_class.represent(group)
end
diff --git a/spec/serializers/pipeline_details_entity_spec.rb b/spec/serializers/pipeline_details_entity_spec.rb
index f270f9fd4cb..a154bcac635 100644
--- a/spec/serializers/pipeline_details_entity_spec.rb
+++ b/spec/serializers/pipeline_details_entity_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
describe PipelineDetailsEntity do
- set(:user) { create(:user) }
+ let_it_be(:user) { create(:user) }
let(:request) { double('request') }
it 'inherrits from PipelineEntity' do
diff --git a/spec/serializers/pipeline_entity_spec.rb b/spec/serializers/pipeline_entity_spec.rb
index 75f3bdfcc9e..914f42054bd 100644
--- a/spec/serializers/pipeline_entity_spec.rb
+++ b/spec/serializers/pipeline_entity_spec.rb
@@ -5,9 +5,9 @@ require 'spec_helper'
describe PipelineEntity do
include Gitlab::Routing
- set(:project) { create(:project) }
- set(:user) { create(:user) }
- set(:project) { create(:project) }
+ let_it_be(:project) { create(:project) }
+ let_it_be(:user) { create(:user) }
+ let_it_be(:project) { create(:project) }
let(:request) { double('request') }
before do
diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb
index 84b0e487ee7..4e4cc9c35e6 100644
--- a/spec/serializers/pipeline_serializer_spec.rb
+++ b/spec/serializers/pipeline_serializer_spec.rb
@@ -3,8 +3,8 @@
require 'spec_helper'
describe PipelineSerializer do
- set(:project) { create(:project, :repository) }
- set(:user) { create(:user) }
+ let_it_be(:project) { create(:project, :repository) }
+ let_it_be(:user) { create(:user) }
let(:serializer) do
described_class.new(current_user: user, project: project)
diff --git a/spec/serializers/project_import_entity_spec.rb b/spec/serializers/project_import_entity_spec.rb
index e476da82729..9ccae798091 100644
--- a/spec/serializers/project_import_entity_spec.rb
+++ b/spec/serializers/project_import_entity_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe ProjectImportEntity do
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(:entity) { described_class.represent(project, provider_url: provider_url) }
diff --git a/spec/serializers/project_serializer_spec.rb b/spec/serializers/project_serializer_spec.rb
index 22f958fc17f..ef3dd1dc15e 100644
--- a/spec/serializers/project_serializer_spec.rb
+++ b/spec/serializers/project_serializer_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
describe ProjectSerializer do
- set(:project) { create(:project) }
+ let_it_be(:project) { create(:project) }
let(:provider_url) { 'http://provider.com' }
context 'when serializer option is :import' do