summaryrefslogtreecommitdiff
path: root/spec/graphql/types/notes/noteable_type_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/graphql/types/notes/noteable_type_spec.rb')
-rw-r--r--spec/graphql/types/notes/noteable_type_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/graphql/types/notes/noteable_type_spec.rb b/spec/graphql/types/notes/noteable_type_spec.rb
new file mode 100644
index 00000000000..d10c79b5344
--- /dev/null
+++ b/spec/graphql/types/notes/noteable_type_spec.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+require 'spec_helper'
+
+describe Types::Notes::NoteableType do
+ it { is_expected.to have_graphql_fields(:notes, :discussions) }
+
+ describe ".resolve_type" do
+ it 'knows the correct type for objects' do
+ expect(described_class.resolve_type(build(:issue), {})).to eq(Types::IssueType)
+ expect(described_class.resolve_type(build(:merge_request), {})).to eq(Types::MergeRequestType)
+ end
+ end
+end