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/models/protected_branch_spec.rb')
-rw-r--r--spec/models/protected_branch_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb
index 019c01af672..587a9683a8e 100644
--- a/spec/models/protected_branch_spec.rb
+++ b/spec/models/protected_branch_spec.rb
@@ -308,4 +308,15 @@ RSpec.describe ProtectedBranch do
expect(described_class.by_name('')).to be_empty
end
end
+
+ describe '.get_ids_by_name' do
+ let(:branch_name) { 'branch_name' }
+ let!(:protected_branch) { create(:protected_branch, name: branch_name) }
+ let(:branch_id) { protected_branch.id }
+
+ it 'returns the id for each protected branch matching name' do
+ expect(described_class.get_ids_by_name([branch_name]))
+ .to match_array([branch_id])
+ end
+ end
end