Skip to content

Fix Projects::MergeRequests::DiffsController specs

Rémy Coutable requested to merge fix-flaky-specs into master

What does this MR do?

Fix Projects::MergeRequests::DiffsController specs

These specs were flaky and only passing after a retry due to how
rspec-retry works.

1. The test with paths that don't exist was returning 200 on the first try,
  then 404 on the second, but not because the paths don't exist, but
  because the MR IID didn't change, thus the MR couldn't be found.
  I decided to remove the test entorely since we don't seem to return 404
  for paths that don't exist.
2. The test with a user that cannot view the merge request was passing
  the first time because the project owner wasn't removed with
  `project.team.truncate`.
  Changing the `let(:user)` to `create(:user)` and calling
  `project.add_maintainer(user)` in the `before` block fix the test.

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Merge request reports