Skip to content

Fix current_patch_id_sha spec to work with factory default

Patrick Bajao requested to merge 429477-fix-flaky-patch-id-spec into master

What does this MR do and why?

In merge_request_spec.rb, we keep the factory default for project for all tests. MergeRequest#current_patch_id_sha, will call project.repository.get_patch_id internally but we are stubbing next instance of Repository.

For it to work properly with factory default and other tests in the spec file, we add message expectation on merge_request.project.repository instead as this ensures that the project factory default was stubbed.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #429477 (closed)

Merge request reports