summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-04-19 09:22:55 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-04-19 09:22:55 +0530
commitf801e2243dcce6d3bdce01acf62fbf5a49a301da (patch)
treee5c4c364f5133ab530581e5da250d5f787390a4a
parentaa396ae5ee5715c1a2a8a82731cef6e3d7f73056 (diff)
downloadgitlab-ce-14566-confidential-issue-branches.tar.gz
A new branch created for a confidential issue is named `<id>-confidential-issue`.14566-confidential-issue-branches
-rw-r--r--app/models/issue.rb2
-rw-r--r--spec/models/issue_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 530d2107596..2f773869603 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index da1c673653a..060e6599104 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -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