Ensure all fork divergence file editing scenarios are covered by rspec tests

Summary

Follow-up from !214096 to ensure all fork divergence scenarios in file editing are covered by rspec tests.

Background

As noted in this comment by @ms.mondrian:

suggestion (non-blocking) - manual testing all the scenarios above is way too much. let's make sure all the scenarios are covered by rspec. i believe a lot of them are already but let's double check that in a follow up.

Scenarios to verify test coverage

The following scenarios should be verified to have adequate rspec coverage:

Editing as a user WITHOUT write access to upstream

Scenario blob_edit_refactor ENABLED blob_edit_refactor DISABLED
File is in sync Should allow edit and commit, redirect to create MR Should allow edit and commit, redirect to create MR
Upstream is ahead Error: "You are attempting to update a file that has changed since you started editing it." Generic error: "An error occurred editing the blob"
Fork is ahead Error: "You are attempting to update a file that has changed since you started editing it." Error: "Can't edit this file. The fork and upstream project have diverged. Edit the file on the fork."

Editing as a user WITH write access to upstream

Similar scenarios should be tested for users with write access.

Tasks

  • Audit existing rspec tests for fork divergence scenarios
  • Identify any gaps in test coverage
  • Add missing tests to ensure all scenarios are covered
  • Ensure tests cover both blob_edit_refactor feature flag states

Related

  • Parent MR: !214096
  • Related issue: #569115
Edited Feb 04, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading