Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
66ca8018
Commit
66ca8018
authored
Apr 12, 2016
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test the `Issue#to_branch_name` method.
parent
91034af3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+11
-2
No files found.
spec/models/issue_spec.rb
View file @
66ca8018
...
@@ -228,10 +228,19 @@ describe Issue, models: true do
...
@@ -228,10 +228,19 @@ describe Issue, models: true do
end
end
describe
"#to_branch_name"
do
describe
"#to_branch_name"
do
let
(
:issue
)
{
create
(
:issue
,
title:
'
a'
*
30
)
}
let
(
:issue
)
{
create
(
:issue
,
title:
'
testing-issue'
)
}
it
"
start
s with the issue iid"
do
it
"
end
s with the issue iid"
do
expect
(
issue
.
to_branch_name
).
to
match
/-
#{
issue
.
iid
}
\z/
expect
(
issue
.
to_branch_name
).
to
match
/-
#{
issue
.
iid
}
\z/
end
end
it
"contains the issue title if not confidential"
do
expect
(
issue
.
to_branch_name
).
to
match
/\Atesting-issue/
end
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/
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment