diff options
Diffstat (limited to 'spec/graphql/types/timelog_type_spec.rb')
-rw-r--r-- | spec/graphql/types/timelog_type_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/graphql/types/timelog_type_spec.rb b/spec/graphql/types/timelog_type_spec.rb new file mode 100644 index 00000000000..38bd70d5097 --- /dev/null +++ b/spec/graphql/types/timelog_type_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GitlabSchema.types['Timelog'] do + let(:fields) { %i[spent_at time_spent user issue note] } + + it { expect(described_class.graphql_name).to eq('Timelog') } + it { expect(described_class).to have_graphql_fields(fields) } + it { expect(described_class).to require_graphql_authorizations(:read_group_timelogs) } + + describe 'user field' do + subject { described_class.fields['user'] } + + it 'returns user' do + is_expected.to have_non_null_graphql_type(Types::UserType) + end + end + + describe 'issue field' do + subject { described_class.fields['issue'] } + + it 'returns issue' do + is_expected.to have_graphql_type(Types::IssueType) + end + end + + describe 'note field' do + subject { described_class.fields['note'] } + + it 'returns note' do + is_expected.to have_graphql_type(Types::Notes::NoteType) + end + end +end |