Skip to content
Snippets Groups Projects
Commit f801e224 authored by Timothy Andrew's avatar Timothy Andrew
Browse files

A new branch created for a confidential issue is named `<id>-confidential-issue`.

parent aa396ae5
No related branches found
No related tags found
1 merge request!3671Sanitize branch names for confidential issues
Pipeline #
Loading
Loading
@@ -158,7 +158,7 @@ class Issue < ActiveRecord::Base
 
def to_branch_name
if self.confidential?
"issue-#{iid}"
"#{iid}-confidential-issue"
else
"#{iid}-#{title.parameterize}"
end
Loading
Loading
Loading
Loading
@@ -248,7 +248,7 @@ describe Issue, models: true do
 
it "does not contain the issue title if confidential" do
issue = create(:issue, title: 'testing-issue', confidential: true)
expect(issue.to_branch_name).to match /\Aissue/
expect(issue.to_branch_name).to match /confidential-issue\z/
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment