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/requests/api/branches_spec.rb')
-rw-r--r--spec/requests/api/branches_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb
index 750b9a39e15..eba1a06b5e4 100644
--- a/spec/requests/api/branches_spec.rb
+++ b/spec/requests/api/branches_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe API::Branches do
+RSpec.describe API::Branches, feature_category: :source_code_management do
let_it_be(:user) { create(:user) }
let(:project) { create(:project, :repository, creator: user, path: 'my.project', create_branch: 'ends-with.txt') }
@@ -344,6 +344,18 @@ RSpec.describe API::Branches do
end
end
+ context 'when branch is ambiguous' do
+ let(:branch_name) { 'prefix' }
+
+ before do
+ project.repository.create_branch('prefix/branch')
+ end
+
+ it_behaves_like '404 response' do
+ let(:request) { get api(route, current_user) }
+ end
+ end
+
context 'when repository does not exist' do
it_behaves_like '404 response' do
let(:project) { create(:project, creator: user) }