diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
commit | db384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch) | |
tree | 34beaef37df5f47ccbcf5729d7583aae093cffa0 /spec/graphql/types/diff_type_spec.rb | |
parent | 54fd7b1bad233e3944434da91d257fa7f63c3996 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'spec/graphql/types/diff_type_spec.rb')
-rw-r--r-- | spec/graphql/types/diff_type_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/graphql/types/diff_type_spec.rb b/spec/graphql/types/diff_type_spec.rb new file mode 100644 index 00000000000..04f4ff9feed --- /dev/null +++ b/spec/graphql/types/diff_type_spec.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GitlabSchema.types['Diff'], feature_category: :code_review_workflow do + include RepoHelpers + include GraphqlHelpers + + specify { expect(described_class.graphql_name).to eq('Diff') } + + it 'contains attributes related to diff' do + expect(described_class).to have_graphql_fields( + :a_mode, :b_mode, :deleted_file, :diff, :new_file, :new_path, :old_path, :renamed_file + ) + end + + describe '#diff' do + subject { resolve_field(:diff, diff, object_type: described_class) } + + let(:merge_request_diff) { create(:merge_request).merge_request_diff } + let(:diff) { merge_request_diff.diffs.diffs.first } + + it 'returns the diff of the passed commit' do + is_expected.to eq(diff.diff) + end + end +end |