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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 03:06:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-14 03:06:38 +0300
commit7ea2b8726c5c587e32d53efd5d9c84cd72ba4356 (patch)
tree79625bb280020ffad5c92b394b401f8a22d0b202 /spec/validators/branch_filter_validator_spec.rb
parent336e1756be5b6ee624f7e4b5f740a434f05f8e94 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/validators/branch_filter_validator_spec.rb')
-rw-r--r--spec/validators/branch_filter_validator_spec.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/spec/validators/branch_filter_validator_spec.rb b/spec/validators/branch_filter_validator_spec.rb
index 3be54827431..957d1dd99bb 100644
--- a/spec/validators/branch_filter_validator_spec.rb
+++ b/spec/validators/branch_filter_validator_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe BranchFilterValidator do
@@ -6,25 +8,25 @@ describe BranchFilterValidator do
describe '#validates_each' do
it 'allows valid branch names' do
- validator.validate_each(hook, :push_events_branch_filter, "good_branch_name")
- validator.validate_each(hook, :push_events_branch_filter, "another/good_branch_name")
+ validator.validate_each(hook, :push_events_branch_filter, +"good_branch_name")
+ validator.validate_each(hook, :push_events_branch_filter, +"another/good_branch_name")
expect(hook.errors.empty?).to be true
end
it 'disallows bad branch names' do
- validator.validate_each(hook, :push_events_branch_filter, "bad branch~name")
+ validator.validate_each(hook, :push_events_branch_filter, +"bad branch~name")
expect(hook.errors[:push_events_branch_filter].empty?).to be false
end
it 'allows wildcards' do
- validator.validate_each(hook, :push_events_branch_filter, "features/*")
- validator.validate_each(hook, :push_events_branch_filter, "features/*/bla")
- validator.validate_each(hook, :push_events_branch_filter, "*-stable")
+ validator.validate_each(hook, :push_events_branch_filter, +"features/*")
+ validator.validate_each(hook, :push_events_branch_filter, +"features/*/bla")
+ validator.validate_each(hook, :push_events_branch_filter, +"*-stable")
expect(hook.errors.empty?).to be true
end
it 'gets rid of whitespace' do
- filter = ' master '
+ filter = +' master '
validator.validate_each(hook, :push_events_branch_filter, filter)
expect(filter).to eq 'master'