Commit a5cdbad0 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'fix-flaky-specs' into 'master'

Fix Projects::MergeRequests::DiffsController specs

See merge request gitlab-org/gitlab-ce!25253
parents 00cb8de1 45ce5ff7
# frozen_string_literal: true # frozen_string_literal: true
class Projects::MergeRequests::DiffsController < Projects::MergeRequests::ApplicationController class Projects::MergeRequests::DiffsController < Projects::MergeRequests::ApplicationController
include DiffForPath
include DiffHelper include DiffHelper
include RendersNotes include RendersNotes
......
...@@ -4,10 +4,11 @@ describe Projects::MergeRequests::DiffsController do ...@@ -4,10 +4,11 @@ describe Projects::MergeRequests::DiffsController do
include ProjectForksHelper include ProjectForksHelper
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { project.owner } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
before do before do
project.add_maintainer(user)
sign_in(user) sign_in(user)
end end
...@@ -114,16 +115,6 @@ describe Projects::MergeRequests::DiffsController do ...@@ -114,16 +115,6 @@ describe Projects::MergeRequests::DiffsController do
expect(paths).to include(existing_path) expect(paths).to include(existing_path)
end end
end end
context 'when the path does not exist in the diff' do
before do
diff_for_path(old_path: 'files/ruby/nopen.rb', new_path: 'files/ruby/nopen.rb')
end
it 'returns a 404' do
expect(response).to have_gitlab_http_status(404)
end
end
end end
context 'when the user cannot view the merge request' do context 'when the user cannot view the merge request' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment