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
78c8bce1
Commit
78c8bce1
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 Issue#to_reference
parent
1c749880
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+10
-1
No files found.
spec/models/issue_spec.rb
View file @
78c8bce1
...
@@ -27,7 +27,11 @@ describe Issue, models: true do
...
@@ -27,7 +27,11 @@ describe Issue, models: true do
let
(
:issue
)
{
build
(
:issue
,
iid:
1
,
project:
project
)
}
let
(
:issue
)
{
build
(
:issue
,
iid:
1
,
project:
project
)
}
it
'returns a String reference to the object'
do
it
'returns a String reference to the object'
do
expect
(
issue
.
to_reference
).
to
eq
"#1"
expect
(
issue
.
to_reference
).
to
eq
"
#{
project
.
namespace
.
name
}
/sample-project#1"
end
it
'supports a project reference'
do
expect
(
issue
.
to_reference
(
project
)).
to
eq
"#1"
end
end
it
'returns a String reference with the full path'
do
it
'returns a String reference with the full path'
do
...
@@ -38,6 +42,11 @@ describe Issue, models: true do
...
@@ -38,6 +42,11 @@ describe Issue, models: true do
another_project
=
build
(
:empty_project
,
name:
'another-project'
,
namespace:
project
.
namespace
)
another_project
=
build
(
:empty_project
,
name:
'another-project'
,
namespace:
project
.
namespace
)
expect
(
issue
.
to_reference
(
another_project
)).
to
eq
"sample-project#1"
expect
(
issue
.
to_reference
(
another_project
)).
to
eq
"sample-project#1"
end
end
it
'supports a group reference'
do
group
=
build
(
:group
,
name:
'sample-group'
)
expect
(
issue
.
to_reference
(
nil
,
group
)).
to
eq
(
"sample-project#1"
)
end
end
end
describe
'#is_being_reassigned?'
do
describe
'#is_being_reassigned?'
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