From aff5c9f3e5ecdd9eee2b2b60ab6367da878582fc Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 16 Jun 2017 15:00:58 +0100 Subject: Add table for merge request commits This is an ID-less table with just three columns: an association to the merge request diff the commit belongs to, the relative order of the commit within the merge request diff, and the commit SHA itself. Previously we stored much more information about the commits, so that we could display them even when they were deleted from the repo. Since 8.0, we ensure that those commits are kept around for as long as the target repo itself is, so we don't need to duplicate that data in the database. --- spec/models/merge_request_diff_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/models/merge_request_diff_spec.rb') diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 4ad4abaa572..edc2f4bb9f0 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -98,7 +98,7 @@ describe MergeRequestDiff, models: true do end it 'saves empty state' do - allow_any_instance_of(MergeRequestDiff).to receive(:commits) + allow_any_instance_of(MergeRequestDiff).to receive_message_chain(:compare, :commits) .and_return([]) mr_diff = create(:merge_request).merge_request_diff @@ -107,14 +107,14 @@ describe MergeRequestDiff, models: true do end end - describe '#commits_sha' do + describe '#commit_shas' do it 'returns all commits SHA using serialized commits' do subject.st_commits = [ { id: 'sha1' }, { id: 'sha2' } ] - expect(subject.commits_sha).to eq(%w(sha1 sha2)) + expect(subject.commit_shas).to eq(%w(sha1 sha2)) end end -- cgit v1.2.1