diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-12 23:37:30 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-12 23:37:30 +0300 |
commit | e4261fe3ce0e6ba38db99323b9fb479c6a182d77 (patch) | |
tree | d555e87d9d28a34f35ed4974653e5e8cebac8c87 /spec/controllers | |
parent | e5a967aa0380a618829e4371012da56de59bc739 (diff) | |
parent | ad2bfeb85756db8c4cea9290be743665efd1c918 (diff) |
Merge branch 'fix-conflict-resolution-with-corrupt-repos' into 'master'
Fix conflict resolution from corrupted upstream
Closes gitlab-ee#2128
See merge request !11298
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 37a253fde9b..0b3492a8fed 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -916,7 +916,9 @@ describe Projects::MergeRequestsController do end it 'returns the file in JSON format' do - content = merge_request_with_conflicts.conflicts.file_for_path(path, path).content + content = MergeRequests::Conflicts::ListService.new(merge_request_with_conflicts). + file_for_path(path, path). + content expect(json_response).to include('old_path' => path, 'new_path' => path, @@ -1040,11 +1042,15 @@ describe Projects::MergeRequestsController do context 'when a file has identical content to the conflict' do before do + content = MergeRequests::Conflicts::ListService.new(merge_request_with_conflicts). + file_for_path('files/ruby/popen.rb', 'files/ruby/popen.rb'). + content + resolved_files = [ { 'new_path' => 'files/ruby/popen.rb', 'old_path' => 'files/ruby/popen.rb', - 'content' => merge_request_with_conflicts.conflicts.file_for_path('files/ruby/popen.rb', 'files/ruby/popen.rb').content + 'content' => content }, { 'new_path' => 'files/ruby/regex.rb', 'old_path' => 'files/ruby/regex.rb', |