Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-28 15:10:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-28 15:10:41 +0300
commitb1e352740bd52771b419829abef0a0ad73141ac1 (patch)
treee86202376eb85b6314ab90fe028c0889098b05ef /spec/serializers
parentaeee5b6a212eafefe3c994fb3731ccfca590a6ba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/integrations/project_entity_spec.rb26
-rw-r--r--spec/serializers/integrations/project_serializer_spec.rb9
2 files changed, 35 insertions, 0 deletions
diff --git a/spec/serializers/integrations/project_entity_spec.rb b/spec/serializers/integrations/project_entity_spec.rb
new file mode 100644
index 00000000000..1564f7fad63
--- /dev/null
+++ b/spec/serializers/integrations/project_entity_spec.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Integrations::ProjectEntity do
+ let_it_be(:project) { create(:project, :with_avatar) }
+
+ let(:entity) do
+ described_class.new(project)
+ end
+
+ context 'as json' do
+ include Gitlab::Routing.url_helpers
+
+ subject { entity.as_json }
+
+ it 'contains needed attributes' do
+ expect(subject).to include(
+ avatar_url: include('uploads'),
+ name: project.name,
+ full_path: project_path(project),
+ full_name: project.full_name
+ )
+ end
+ end
+end
diff --git a/spec/serializers/integrations/project_serializer_spec.rb b/spec/serializers/integrations/project_serializer_spec.rb
new file mode 100644
index 00000000000..053548075bb
--- /dev/null
+++ b/spec/serializers/integrations/project_serializer_spec.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Integrations::ProjectSerializer do
+ it 'represents Integrations::ProjectEntity entities' do
+ expect(described_class.entity_class).to eq(Integrations::ProjectEntity)
+ end
+end