summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-03-19 18:54:18 +0000
committerDouwe Maan <douwe@gitlab.com>2016-03-19 18:54:18 +0000
commitcb124d1476bb24d25fc93885c892c5003ec60918 (patch)
tree592cc59416332cec8deb75423da52569e0315ea1 /spec/models
parent4f0302f00ef0c51b67b73429ace0a632971b7f1b (diff)
parent70ca3370ebc840ce8272c78bd7ff7f5ea0c957b1 (diff)
downloadgitlab-ce-cb124d1476bb24d25fc93885c892c5003ec60918.tar.gz
Merge branch 'issue-branch-iid-postfix' into 'master'
#to_branch_name now uses the iid as postfix Given the branch name 'mep-mep' with an iid being 1, the current way, master's way, would yield a branch name of 1-mep-mep. The problem for larger projects however would be that a developer might forget what iid the issue was. When this developer would try to tab complete it would: - Or result in 20+ branches possibly - Or start with the wrong digit, try again with digit++ - Would see 20 branches, repeat Thus the obvious way of solving this is letting the dev tab complete on the issue title, which is easier to remember. @DouweM Should this be labelled `pick-in-master`? See merge request !3308
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/issue_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 2ccdec1eeff..540a62eb1f8 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -131,7 +131,7 @@ describe Issue, models: true do
end
describe '#related_branches' do
- it "should " do
+ it "selects the right branches" do
allow(subject.project.repository).to receive(:branch_names).
and_return(["mpempe", "#{subject.iid}mepmep", subject.to_branch_name])
@@ -151,10 +151,10 @@ describe Issue, models: true do
end
describe "#to_branch_name" do
- let(:issue) { build(:issue, title: 'a' * 30) }
+ let(:issue) { create(:issue, title: 'a' * 30) }
it "starts with the issue iid" do
- expect(issue.to_branch_name).to match /\A#{issue.iid}-a+\z/
+ expect(issue.to_branch_name).to match /-#{issue.iid}\z/
end
end
end