Commit 44f6fce0 authored by Kerri Miller's avatar Kerri Miller

Merge branch '285287-include-submodule-information-for-files-in-diff-metadata' into 'master'

Include submodule information for files in diff metadata

See merge request gitlab-org/gitlab!50346
parents 34a08f2f 5eb626b5
......@@ -7,6 +7,7 @@ class DiffFileMetadataEntity < Grape::Entity
expose :old_path
expose :new_file?, as: :new_file
expose :deleted_file?, as: :deleted_file
expose :submodule?, as: :submodule
expose :file_identifier_hash
expose :file_hash
end
---
title: Include submodule information for files in diff metadata
merge_request: 50346
author: Simon Stieger @sim0
type: fixed
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe DiffFileMetadataEntity do
let(:merge_request) { create(:merge_request_with_diffs) }
let(:raw_diff_file) { merge_request.merge_request_diff.diffs.raw_diff_files.first }
let(:entity) { described_class.new(raw_diff_file) }
context 'as json' do
subject { entity.as_json }
it 'exposes the expected fields' do
expect(subject.keys).to contain_exactly(
:added_lines,
:removed_lines,
:new_path,
:old_path,
:new_file,
:deleted_file,
:submodule,
:file_identifier_hash,
:file_hash
)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment