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:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-02-12 21:42:25 +0300
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-03-15 22:21:11 +0300
commit228007dfbcd8f97c66c1802f3b69abd7d02c7d26 (patch)
treed548ef9928b96816b7987b97eff4c8028c1ca30f /spec/models/issue_spec.rb
parentbc590ce63bd2f1af5545b648e6d028a557e7c792 (diff)
new-branch-button
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 7f44ca2f7db..d572a71cf46 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -140,4 +140,16 @@ describe Issue, models: true do
it_behaves_like 'a Taskable' do
let(:subject) { create :issue }
end
+
+ describe "#to_branch_name" do
+ let(:issue) { build(:issue, title: 'a' * 30) }
+
+ it "is expected not to exceed 25 chars" do
+ expect(issue.to_branch_name.length).to eq 25
+ end
+
+ it "starts with the issue iid" do
+ expect(issue.to_branch_name).to match /\A#{issue.iid}-a+\z/
+ end
+ end
end