Commit 0026c655 authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'allow-completed-tasks-in-upper-case' into 'master'

Use case-insensitive matches for tasks

See merge request !605
parents 749b02fa 05e316dd
......@@ -20,11 +20,11 @@ module ReleaseTools
# * [ ] Task name here
# - [x] Task name here
# * [x] Task name here
ALL_TASKS = /(\*|-)\s*\[(\s+|x)\]/.freeze
ALL_TASKS = /(\*|-)\s*\[(\s+|[xX])\]/.freeze
# A regular expression to use to determine if the merge request was
# assigned to a reviewer.
APPROVED_TASK = /-\s*\[x\]\s*Assign to a reviewer/.freeze
APPROVED_TASK = /-\s*\[[xX]\]\s*Assign to a reviewer/.freeze
# A regular expression used to determine if the target branch of a merge
# request is valid.
......
......@@ -199,7 +199,7 @@ describe ReleaseTools::Security::MergeRequestValidator do
end
it 'does not add an error when at least one task is present' do
merge_request = double(:merge_request, description: '- [ ] Foo')
merge_request = double(:merge_request, description: '- [X] Foo')
client = double(:client)
validator = described_class.new(merge_request, client)
......@@ -232,6 +232,18 @@ describe ReleaseTools::Security::MergeRequestValidator do
expect(validator.errors).to be_empty
end
it 'does not add an error when the merge request is reviewed using a manual edit' do
merge_request =
double(:merge_request, description: '- [X] Assign to a reviewer')
client = double(:client)
validator = described_class.new(merge_request, client)
validator.validate_reviewed
expect(validator.errors).to be_empty
end
end
describe '#validate_target_branch' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment