summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-06-07 19:13:26 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2019-06-14 12:36:27 +0200
commitb6ff5f1e141162e701c33647aae5015e5d42cc11 (patch)
treefb6ec57e96dc811d07c75d6b32f9471263c85166 /spec/models
parent8934ddbb47d24dac937351588bc28551bd7654e7 (diff)
downloadgitlab-ce-b6ff5f1e141162e701c33647aae5015e5d42cc11.tar.gz
Expose comments on Noteables in GraphQL
This exposes `Note`s on Issues & MergeRequests using a `Types::Notes::NoteableType` in GraphQL. Exposing notes on a new type can be done by implementing the `NoteableType` interface on the type. The presented object should be a `Noteable`.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/discussion_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/discussion_spec.rb b/spec/models/discussion_spec.rb
index 0d02165787a..22d4dab0617 100644
--- a/spec/models/discussion_spec.rb
+++ b/spec/models/discussion_spec.rb
@@ -29,4 +29,12 @@ describe Discussion do
])
end
end
+
+ describe 'authorization' do
+ it 'delegates to the first note' do
+ policy = DeclarativePolicy.policy_for(instance_double(User, id: 1), subject)
+
+ expect(policy).to be_a(NotePolicy)
+ end
+ end
end