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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0393f713
Commit
0393f713
authored
Mar 17, 2022
by
anna_vovchenko
Committed by
charlie ablett
Mar 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added spec for the default_branch_name method
parent
7547d6b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
spec/helpers/clusters_helper_spec.rb
spec/helpers/clusters_helper_spec.rb
+29
-0
No files found.
spec/helpers/clusters_helper_spec.rb
View file @
0393f713
...
...
@@ -224,4 +224,33 @@ RSpec.describe ClustersHelper do
end
end
end
describe
'#default_branch_name'
do
subject
{
default_branch_name
(
clusterable
)
}
context
'when clusterable is a project without a repository'
do
let
(
:clusterable
)
{
build
(
:project
)
}
it
'allows default branch name to display default name from settings'
do
expect
(
subject
).
to
eq
(
Gitlab
::
CurrentSettings
.
default_branch_name
)
end
end
context
'when clusterable is a project with a repository'
do
let
(
:clusterable
)
{
build
(
:project
,
:repository
)
}
let
(
:repository
)
{
clusterable
.
repository
}
it
'allows default branch name to display repository root branch'
do
expect
(
subject
).
to
eq
(
repository
.
root_ref
)
end
end
context
'when clusterable is a group'
do
let
(
:clusterable
)
{
build
(
:group
)
}
it
'does not allow default branch name to display'
do
expect
(
subject
).
to
be_nil
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