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
Jérome Perrin
gitlab-ce
Commits
861a5148
Commit
861a5148
authored
Sep 05, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for a couple more Repository methods used by discover_default_branch
parent
443e23e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/roles/repository_spec.rb
spec/roles/repository_spec.rb
+24
-0
No files found.
spec/roles/repository_spec.rb
View file @
861a5148
...
...
@@ -45,4 +45,28 @@ describe Project, "Repository" do
project
.
discover_default_branch
.
should
be_nil
end
end
describe
"#root_ref"
do
it
"returns default_branch when set"
do
project
.
default_branch
=
'stable'
project
.
root_ref
.
should
==
'stable'
end
it
"returns 'master' when default_branch is nil"
do
project
.
default_branch
=
nil
project
.
root_ref
.
should
==
'master'
end
end
describe
"#root_ref?"
do
it
"returns true when branch is root_ref"
do
project
.
default_branch
=
'stable'
project
.
root_ref?
(
'stable'
).
should
be_true
end
it
"returns false when branch is not root_ref"
do
project
.
default_branch
=
nil
project
.
root_ref?
(
'stable'
).
should
be_false
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