diff options
Diffstat (limited to 'spec/graphql/types')
-rw-r--r-- | spec/graphql/types/query_type_spec.rb | 2 | ||||
-rw-r--r-- | spec/graphql/types/todo_type_spec.rb | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/graphql/types/query_type_spec.rb b/spec/graphql/types/query_type_spec.rb index 784a4f4b4c9..1365bc0dc14 100644 --- a/spec/graphql/types/query_type_spec.rb +++ b/spec/graphql/types/query_type_spec.rb @@ -7,7 +7,7 @@ describe GitlabSchema.types['Query'] do expect(described_class.graphql_name).to eq('Query') end - it { is_expected.to have_graphql_fields(:project, :namespace, :group, :echo, :metadata) } + it { is_expected.to have_graphql_fields(:project, :namespace, :group, :echo, :metadata, :current_user) } describe 'namespace field' do subject { described_class.fields['namespace'] } diff --git a/spec/graphql/types/todo_type_spec.rb b/spec/graphql/types/todo_type_spec.rb new file mode 100644 index 00000000000..a5ea5bcffb0 --- /dev/null +++ b/spec/graphql/types/todo_type_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe GitlabSchema.types['Todo'] do + it 'has the correct fields' do + expected_fields = [:id, :project, :group, :author, :action, :target_type, :body, :state, :created_at] + + is_expected.to have_graphql_fields(*expected_fields) + end + + it { expect(described_class).to require_graphql_authorizations(:read_todo) } +end |