diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-06-07 19:13:26 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-06-14 12:36:27 +0200 |
commit | b6ff5f1e141162e701c33647aae5015e5d42cc11 (patch) | |
tree | fb6ec57e96dc811d07c75d6b32f9471263c85166 /spec/models | |
parent | 8934ddbb47d24dac937351588bc28551bd7654e7 (diff) | |
download | gitlab-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.rb | 8 |
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 |