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
Tatuya Kamada
gitlab-ce
Commits
08481a71
Commit
08481a71
authored
Dec 15, 2016
by
Berna Castro
Committed by
Oswaldo Ferreira
Jan 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and add specs for Project#to_reference
parent
78c8bce1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
spec/models/project_spec.rb
spec/models/project_spec.rb
+9
-3
No files found.
spec/models/project_spec.rb
View file @
08481a71
...
@@ -287,8 +287,8 @@ describe Project, models: true do
...
@@ -287,8 +287,8 @@ describe Project, models: true do
let
(
:project
)
{
create
(
:empty_project
,
path:
'sample-project'
,
namespace:
namespace
)
}
let
(
:project
)
{
create
(
:empty_project
,
path:
'sample-project'
,
namespace:
namespace
)
}
context
'when nil argument'
do
context
'when nil argument'
do
it
'returns
nil
'
do
it
'returns
complete path to the project
'
do
expect
(
project
.
to_reference
).
to
be_nil
expect
(
project
.
to_reference
).
to
eq
'sample-namespace/sample-project'
end
end
end
end
...
@@ -309,10 +309,16 @@ describe Project, models: true do
...
@@ -309,10 +309,16 @@ describe Project, models: true do
context
'when same namespace / cross-project argument'
do
context
'when same namespace / cross-project argument'
do
let
(
:another_project
)
{
create
(
:empty_project
,
namespace:
namespace
)
}
let
(
:another_project
)
{
create
(
:empty_project
,
namespace:
namespace
)
}
it
'returns
complete
path to the project'
do
it
'returns path to the project'
do
expect
(
project
.
to_reference
(
another_project
)).
to
eq
'sample-project'
expect
(
project
.
to_reference
(
another_project
)).
to
eq
'sample-project'
end
end
end
end
context
'when group argument'
do
it
'returns path to the project'
do
expect
(
project
.
to_reference
(
nil
,
namespace
)).
to
eq
'sample-project'
end
end
end
end
describe
'#to_human_reference'
do
describe
'#to_human_reference'
do
...
...
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