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:
Diffstat (limited to 'spec/graphql/types/projects/service_type_spec.rb')
-rw-r--r--spec/graphql/types/projects/service_type_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/graphql/types/projects/service_type_spec.rb b/spec/graphql/types/projects/service_type_spec.rb
new file mode 100644
index 00000000000..ad30a4008bc
--- /dev/null
+++ b/spec/graphql/types/projects/service_type_spec.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Types::Projects::ServiceType do
+ it { expect(described_class).to have_graphql_fields(:type, :active) }
+
+ describe ".resolve_type" do
+ it 'resolves the corresponding type for objects' do
+ expect(described_class.resolve_type(build(:jira_service), {})).to eq(Types::Projects::Services::JiraServiceType)
+ expect(described_class.resolve_type(build(:service), {})).to eq(Types::Projects::Services::BaseServiceType)
+ expect(described_class.resolve_type(build(:alerts_service), {})).to eq(Types::Projects::Services::BaseServiceType)
+ expect(described_class.resolve_type(build(:custom_issue_tracker_service), {})).to eq(Types::Projects::Services::BaseServiceType)
+ end
+ end
+end