• Rémy Coutable's avatar
    Fix Projects::MergeRequests::DiffsController specs · 45ce5ff7
    Rémy Coutable authored
    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, 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 entirely 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 failing
      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.
    Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
    45ce5ff7
diffs_controller.rb 3.16 KB