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
ef67b703
Commit
ef67b703
authored
Feb 25, 2020
by
John Hope
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused tests and avoid creating database rows
parent
7aa49e4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
36 deletions
+32
-36
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+32
-36
No files found.
spec/models/issue_spec.rb
View file @
ef67b703
...
@@ -178,67 +178,63 @@ describe Issue do
...
@@ -178,67 +178,63 @@ describe Issue do
let
(
:namespace
)
{
build
(
:namespace
,
path:
'sample-namespace'
)
}
let
(
:namespace
)
{
build
(
:namespace
,
path:
'sample-namespace'
)
}
let
(
:project
)
{
build
(
:project
,
name:
'sample-project'
,
namespace:
namespace
)
}
let
(
:project
)
{
build
(
:project
,
name:
'sample-project'
,
namespace:
namespace
)
}
let
(
:issue
)
{
build
(
:issue
,
iid:
1
,
project:
project
)
}
let
(
:issue
)
{
build
(
:issue
,
iid:
1
,
project:
project
)
}
let
(
:group
)
{
create
(
:group
,
name:
'Group'
,
path:
'sample-group'
)
}
context
'when nil argument'
do
context
'when nil argument'
do
it
'returns issue id'
do
it
'returns issue id'
do
expect
(
issue
.
to_reference
).
to
eq
"#1"
expect
(
issue
.
to_reference
).
to
eq
"#1"
end
end
end
context
'when full is true'
do
it
'returns complete path to the issue with full: true'
do
it
'returns complete path to the issue'
do
expect
(
issue
.
to_reference
(
full:
true
)).
to
eq
'sample-namespace/sample-project#1'
expect
(
issue
.
to_reference
(
full:
true
)).
to
eq
'sample-namespace/sample-project#1'
expect
(
issue
.
to_reference
(
project
,
full:
true
)).
to
eq
'sample-namespace/sample-project#1'
expect
(
issue
.
to_reference
(
group
,
full:
true
)).
to
eq
'sample-namespace/sample-project#1'
end
end
end
end
context
'when same project argument'
do
context
'when argument is a project'
do
context
'when same project'
do
it
'returns issue id'
do
it
'returns issue id'
do
expect
(
issue
.
to_reference
(
project
)).
to
eq
(
"#1"
)
expect
(
issue
.
to_reference
(
project
)).
to
eq
(
"#1"
)
end
end
end
context
'when cross namespace project argument'
do
let
(
:another_namespace_project
)
{
create
(
:project
,
name:
'another-project'
)
}
it
'returns complete path to the iss
ue'
do
it
'returns full reference with full: tr
ue'
do
expect
(
issue
.
to_reference
(
another_namespace_project
)).
to
eq
'sample-namespace/sample-project#1'
expect
(
issue
.
to_reference
(
project
,
full:
true
)).
to
eq
'sample-namespace/sample-project#1'
end
end
end
end
it
'supports a cross-project referen
ce'
do
context
'when cross-project in same namespa
ce'
do
another_project
=
build
(
:project
,
name:
'another-project'
,
namespace:
project
.
namespace
)
let
(
:another_project
)
do
expect
(
issue
.
to_reference
(
another_project
)).
to
eq
"sample-project#1"
build
(
:project
,
name:
'another-project'
,
namespace:
project
.
namespace
)
end
end
context
'when same namespace / cross-project argument'
do
it
'returns a cross-project reference'
do
let
(
:another_project
)
{
create
(
:project
,
namespace:
namespace
)
}
expect
(
issue
.
to_reference
(
another_project
)).
to
eq
"sample-project#1"
it
'returns path to the issue with the project name'
do
expect
(
issue
.
to_reference
(
another_project
)).
to
eq
'sample-project#1'
end
end
end
end
context
'when different namespace / cross-project argument
'
do
context
'when cross-project in different namespace
'
do
let
(
:another_namespace
)
{
create
(
:namespace
,
path:
'another-namespace'
)
}
let
(
:another_namespace
)
{
build
(
:namespace
,
path:
'another-namespace'
)
}
let
(
:another_project
)
{
create
(
:project
,
path:
'another-project'
,
namespace:
another_namespace
)
}
let
(
:another_namespace_project
)
{
build
(
:project
,
path:
'another-project'
,
namespace:
another_namespace
)
}
it
'returns full path to the issue'
do
it
'returns complete path to the issue'
do
expect
(
issue
.
to_reference
(
another_project
)).
to
eq
'sample-namespace/sample-project#1'
expect
(
issue
.
to_reference
(
another_namespace_project
)).
to
eq
'sample-namespace/sample-project#1'
end
end
end
end
end
context
'when argument is a namespace'
do
context
'when argument is a namespace'
do
context
'w
ith same project path
'
do
context
'w
hen same as issue
'
do
it
'returns path to the issue with the project name'
do
it
'returns path to the issue with the project name'
do
expect
(
issue
.
to_reference
(
namespace
)).
to
eq
'sample-project#1'
expect
(
issue
.
to_reference
(
namespace
)).
to
eq
'sample-project#1'
end
end
it
'returns full reference with full: true'
do
expect
(
issue
.
to_reference
(
namespace
,
full:
true
)).
to
eq
'sample-namespace/sample-project#1'
end
end
end
context
'with different project path'
do
context
'when different to issue namespace'
do
it
'returns full path to the issue'
do
let
(
:group
)
{
build
(
:group
,
name:
'Group'
,
path:
'sample-group'
)
}
it
'returns full path to the issue with full: true'
do
expect
(
issue
.
to_reference
(
group
)).
to
eq
'sample-namespace/sample-project#1'
expect
(
issue
.
to_reference
(
group
)).
to
eq
'sample-namespace/sample-project#1'
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