2019-10-17 09:07:07 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-25 08:59:00 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-06-26 16:31:05 +00:00
|
|
|
describe GitlabSchema.types['MergeRequest'] do
|
2018-06-25 08:59:00 +00:00
|
|
|
it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::MergeRequest) }
|
2018-06-26 16:31:05 +00:00
|
|
|
|
2019-03-04 02:30:32 +00:00
|
|
|
it { expect(described_class).to require_graphql_authorizations(:read_merge_request) }
|
2018-06-26 16:31:05 +00:00
|
|
|
|
2019-06-07 17:13:26 +00:00
|
|
|
it { expect(described_class.interfaces).to include(Types::Notes::NoteableType.to_graphql) }
|
|
|
|
|
2019-06-20 08:02:33 +00:00
|
|
|
it 'has the expected fields' do
|
|
|
|
expected_fields = %w[
|
|
|
|
notes discussions user_permissions id iid title title_html description
|
|
|
|
description_html state created_at updated_at source_project target_project
|
|
|
|
project project_id source_project_id target_project_id source_branch
|
|
|
|
target_branch work_in_progress merge_when_pipeline_succeeds diff_head_sha
|
2019-07-02 03:17:02 +00:00
|
|
|
merge_commit_sha user_notes_count should_remove_source_branch diff_refs
|
2019-06-20 08:02:33 +00:00
|
|
|
force_remove_source_branch merge_status in_progress_merge_commit_sha
|
|
|
|
merge_error allow_collaboration should_be_rebased rebase_commit_sha
|
|
|
|
rebase_in_progress merge_commit_message default_merge_commit_message
|
|
|
|
merge_ongoing source_branch_exists mergeable_discussions_state web_url
|
2019-10-17 21:06:41 +00:00
|
|
|
upvotes downvotes head_pipeline pipelines task_completion_status
|
|
|
|
milestone assignees participants subscribed labels discussion_locked time_estimate
|
|
|
|
total_time_spent reference
|
2019-06-20 08:02:33 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
is_expected.to have_graphql_fields(*expected_fields)
|
2018-06-26 16:31:05 +00:00
|
|
|
end
|
2018-06-25 08:59:00 +00:00
|
|
|
end
|