Commit 5eb626b5 authored by Simon Stieger's avatar Simon Stieger

Include submodule information for files in diff metadata

parent ce7382e7
...@@ -7,6 +7,7 @@ class DiffFileMetadataEntity < Grape::Entity ...@@ -7,6 +7,7 @@ class DiffFileMetadataEntity < Grape::Entity
expose :old_path expose :old_path
expose :new_file?, as: :new_file expose :new_file?, as: :new_file
expose :deleted_file?, as: :deleted_file expose :deleted_file?, as: :deleted_file
expose :submodule?, as: :submodule
expose :file_identifier_hash expose :file_identifier_hash
expose :file_hash expose :file_hash
end 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