summaryrefslogtreecommitdiff
path: root/spec/graphql
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-05-21 09:52:24 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-06-05 20:47:42 +0200
commitaa4b1ae71260720b47695b8a256134f20280f61a (patch)
tree81020f291d634e76fe0a31d906ed73639f634b7d /spec/graphql
parent287c34ca1f9af4e395493c99623af8437f82d919 (diff)
downloadgitlab-ce-aa4b1ae71260720b47695b8a256134f20280f61a.tar.gz
Add `present_using` to types
By specifying a presenter for the object type, we can keep the logic out of `GitlabSchema`. The presenter gets initialized using the object being presented, and the context (including the `current_user`).
Diffstat (limited to 'spec/graphql')
-rw-r--r--spec/graphql/gitlab_schema_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/graphql/gitlab_schema_spec.rb b/spec/graphql/gitlab_schema_spec.rb
index 070b851b109..f25cc2fd6c9 100644
--- a/spec/graphql/gitlab_schema_spec.rb
+++ b/spec/graphql/gitlab_schema_spec.rb
@@ -13,7 +13,14 @@ describe GitlabSchema do
expect(field_instrumenters).to include(instance_of(::Gitlab::Graphql::Authorize))
end
+ it 'enables using presenters' do
+ expect(field_instrumenters).to include(instance_of(::Gitlab::Graphql::Present))
+ end
+
it 'has the base mutation' do
+ pending <<~REASON
+ Having empty mutations breaks the automatic documentation in Graphiql, so removed for now."
+ REASON
expect(described_class.mutation).to eq(::Types::MutationType)
end