summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-02-18 15:07:59 +0000
committerNick Thomas <nick@gitlab.com>2019-02-18 15:07:59 +0000
commita5cdbad0a6826e3c4ef295b9b6ec0cab24a50e84 (patch)
treec72d4d4330b972ca6c5f0a55f00aebfe7524fe88
parent00cb8de1ecd45ceb56edbb2f9fc3699669881078 (diff)
parent45ce5ff7ea19254b16a721329820712d68886298 (diff)
downloadgitlab-ce-a5cdbad0a6826e3c4ef295b9b6ec0cab24a50e84.tar.gz
Merge branch 'fix-flaky-specs' into 'master'
Fix Projects::MergeRequests::DiffsController specs See merge request gitlab-org/gitlab-ce!25253
-rw-r--r--app/controllers/projects/merge_requests/diffs_controller.rb1
-rw-r--r--spec/controllers/projects/merge_requests/diffs_controller_spec.rb13
2 files changed, 2 insertions, 12 deletions
diff --git a/app/controllers/projects/merge_requests/diffs_controller.rb b/app/controllers/projects/merge_requests/diffs_controller.rb
index ddffbb17ace..518d41bd3fb 100644
--- a/app/controllers/projects/merge_requests/diffs_controller.rb
+++ b/app/controllers/projects/merge_requests/diffs_controller.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
class Projects::MergeRequests::DiffsController < Projects::MergeRequests::ApplicationController
- include DiffForPath
include DiffHelper
include RendersNotes
diff --git a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb
index a6017d8e5e6..e85f32d6e30 100644
--- a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb
+++ b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb
@@ -4,10 +4,11 @@ describe Projects::MergeRequests::DiffsController do
include ProjectForksHelper
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) }
before do
+ project.add_maintainer(user)
sign_in(user)
end
@@ -114,16 +115,6 @@ describe Projects::MergeRequests::DiffsController do
expect(paths).to include(existing_path)
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
context 'when the user cannot view the merge request' do