Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects/compare_controller_spec.rb')
-rw-r--r--spec/controllers/projects/compare_controller_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/controllers/projects/compare_controller_spec.rb b/spec/controllers/projects/compare_controller_spec.rb
index 7dc9bcd9677..662d2920e12 100644
--- a/spec/controllers/projects/compare_controller_spec.rb
+++ b/spec/controllers/projects/compare_controller_spec.rb
@@ -282,6 +282,19 @@ RSpec.describe Projects::CompareController, feature_category: :source_code_manag
end
end
+ context 'when the from_ref and to_ref are the same' do
+ let(:from_project_id) { nil }
+ let(:from_ref) { 'master' }
+ let(:to_ref) { "master" }
+
+ it 'shows a message that refs are identical' do
+ show_request
+
+ expect(response).to be_successful
+ expect(response.body).to include('are the same')
+ end
+ end
+
context 'when the source ref is invalid' do
let(:from_project_id) { nil }
let(:from_ref) { "master%' AND 2554=4423 AND '%'='" }