diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 00:06:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-02 00:06:26 +0000 |
commit | 587794b4b8a6e919e77ee4abe8215fa291e6a91d (patch) | |
tree | 380d6578d1ab5902bb521071128bafd4f70472ef /spec/graphql | |
parent | e0bd3a45d9dc6c74cac1a33ea8c03d6d8334249b (diff) | |
download | gitlab-ce-587794b4b8a6e919e77ee4abe8215fa291e6a91d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r-- | spec/graphql/types/extended_issue_type_spec.rb | 19 | ||||
-rw-r--r-- | spec/graphql/types/issue_type_spec.rb | 5 | ||||
-rw-r--r-- | spec/graphql/types/project_type_spec.rb | 18 |
3 files changed, 40 insertions, 2 deletions
diff --git a/spec/graphql/types/extended_issue_type_spec.rb b/spec/graphql/types/extended_issue_type_spec.rb new file mode 100644 index 00000000000..047f4a90d54 --- /dev/null +++ b/spec/graphql/types/extended_issue_type_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe GitlabSchema.types['ExtendedIssue'] do + it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Issue) } + + it { expect(described_class.graphql_name).to eq('ExtendedIssue') } + + it { expect(described_class).to require_graphql_authorizations(:read_issue) } + + it { expect(described_class.interfaces).to include(Types::Notes::NoteableType.to_graphql) } + + it 'has specific fields' do + fields = Types::IssueType.fields.keys + [:subscribed] + + fields.each do |field_name| + expect(described_class).to have_graphql_field(field_name) + end + end +end diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb index 734e5af3cd8..1621319e618 100644 --- a/spec/graphql/types/issue_type_spec.rb +++ b/spec/graphql/types/issue_type_spec.rb @@ -10,8 +10,9 @@ describe GitlabSchema.types['Issue'] do it { expect(described_class.interfaces).to include(Types::Notes::NoteableType.to_graphql) } it 'has specific fields' do - fields = %i[title_html description_html relative_position web_path web_url - reference] + fields = %i[iid title description state reference author assignees participants labels epic milestone due_date + confidential discussion_locked upvotes downvotes user_notes_count web_path web_url relative_position + time_estimate total_time_spent closed_at created_at updated_at task_completion_status] fields.each do |field_name| expect(described_class).to have_graphql_field(field_name) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index 69fbc72bdf5..739e48044d1 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -25,4 +25,22 @@ describe GitlabSchema.types['Project'] do is_expected.to have_graphql_fields(*expected_fields) end + + describe 'issue field' do + subject { described_class.fields['issue'] } + + it 'returns issue' do + is_expected.to have_graphql_type(Types::ExtendedIssueType) + is_expected.to have_graphql_resolver(Resolvers::IssuesResolver.single) + end + end + + describe 'issues field' do + subject { described_class.fields['issues'] } + + it 'returns issue' do + is_expected.to have_graphql_type(Types::IssueType.connection_type) + is_expected.to have_graphql_resolver(Resolvers::IssuesResolver) + end + end end |