Failure in /spec/controllers/projects/merge_requests/diffs_controller_spec.rb
Failure in /spec/controllers/projects/merge_requests/diffs_controller_spec.rb
MR had a green pipeline, cherry picked the commits from a CE MR and now the pipeline is failing with the following error. Same happened with @kushalpandya
https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/44436848 https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/44385274
Failures:
1) Projects::MergeRequests::DiffsController GET diff_for_path when the merge request exists when the user can view the merge request when the path exists in the diff enables diff notes
Failure/Error:
expect(assigns(:new_diff_note_attrs)).to eq(noteable_type: 'MergeRequest',
noteable_id: merge_request.id,
commit_id: nil)
expected: {:noteable_type=>"MergeRequest", :noteable_id=>8, :commit_id=>nil}
got: {:noteable_type=>"MergeRequest", :noteable_id=>5, :commit_id=>nil}
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
:commit_id => nil,
-:noteable_id => 8,
+:noteable_id => 5,
:noteable_type => "MergeRequest",
# ./spec/controllers/projects/merge_requests/diffs_controller_spec.rb:102:in `block (6 levels) in <top (required)>'
2) Projects::MergeRequests::DiffsController GET diff_for_path when the merge request exists when the user can view the merge request when the path exists in the diff only renders the diffs for the path given
Failure/Error:
expect(controller).to receive(:render_diff_for_path).and_wrap_original do |meth, diffs|
expect(diffs.diff_files.map(&:new_path)).to contain_exactly(existing_path)
meth.call(diffs)
end