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
e918493f
Commit
e918493f
authored
Jan 14, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs and rubocop warnings
parent
33ea09bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
features/steps/shared/project.rb
features/steps/shared/project.rb
+1
-1
spec/models/note_spec.rb
spec/models/note_spec.rb
+2
-2
spec/requests/api/notes_spec.rb
spec/requests/api/notes_spec.rb
+6
-5
No files found.
features/steps/shared/project.rb
View file @
e918493f
...
@@ -224,7 +224,7 @@ module SharedProject
...
@@ -224,7 +224,7 @@ module SharedProject
end
end
def
user_owns_project
(
user_name
:,
project_name
:,
visibility: :private
)
def
user_owns_project
(
user_name
:,
project_name
:,
visibility: :private
)
user
=
user_exists
(
user_name
,
username:
user_name
.
underscore
)
user
=
user_exists
(
user_name
,
username:
user_name
.
gsub
(
/\s/
,
''
).
underscore
)
project
=
Project
.
find_by
(
name:
project_name
)
project
=
Project
.
find_by
(
name:
project_name
)
project
||=
create
(
:empty_project
,
visibility
,
name:
project_name
,
namespace:
user
.
namespace
)
project
||=
create
(
:empty_project
,
visibility
,
name:
project_name
,
namespace:
user
.
namespace
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
...
...
spec/models/note_spec.rb
View file @
e918493f
...
@@ -186,12 +186,12 @@ describe Note, models: true do
...
@@ -186,12 +186,12 @@ describe Note, models: true do
let
(
:ext_proj
)
{
create
(
:project
,
:public
)
}
let
(
:ext_proj
)
{
create
(
:project
,
:public
)
}
let
(
:ext_issue
)
{
create
(
:issue
,
project:
ext_proj
)
}
let
(
:ext_issue
)
{
create
(
:issue
,
project:
ext_proj
)
}
let
(
:note
)
{
let
(
:note
)
do
create
:note
,
create
:note
,
noteable:
ext_issue
,
project:
ext_proj
,
noteable:
ext_issue
,
project:
ext_proj
,
note:
"mentioned in issue
#{
private_issue
.
to_reference
(
ext_proj
)
}
"
,
note:
"mentioned in issue
#{
private_issue
.
to_reference
(
ext_proj
)
}
"
,
system:
true
system:
true
}
end
it
"returns true"
do
it
"returns true"
do
expect
(
note
.
cross_reference_not_visible_for?
(
ext_issue
.
author
)).
to
be_truthy
expect
(
note
.
cross_reference_not_visible_for?
(
ext_issue
.
author
)).
to
be_truthy
...
...
spec/requests/api/notes_spec.rb
View file @
e918493f
...
@@ -13,20 +13,21 @@ describe API::API, api: true do
...
@@ -13,20 +13,21 @@ describe API::API, api: true do
# For testing the cross-reference of a private issue in a public issue
# For testing the cross-reference of a private issue in a public issue
let
(
:private_user
)
{
create
(
:user
)
}
let
(
:private_user
)
{
create
(
:user
)
}
let
(
:private_project
)
{
let
(
:private_project
)
do
create
(
:project
,
namespace:
private_user
.
namespace
).
create
(
:project
,
namespace:
private_user
.
namespace
).
tap
{
|
p
|
p
.
team
<<
[
private_user
,
:master
]
}
tap
{
|
p
|
p
.
team
<<
[
private_user
,
:master
]
}
}
end
let
(
:private_issue
)
{
create
(
:issue
,
project:
private_project
)
}
let
(
:private_issue
)
{
create
(
:issue
,
project:
private_project
)
}
let
(
:ext_proj
)
{
create
(
:project
,
:public
)
}
let
(
:ext_proj
)
{
create
(
:project
,
:public
)
}
let
(
:ext_issue
)
{
create
(
:issue
,
project:
ext_proj
)
}
let
(
:ext_issue
)
{
create
(
:issue
,
project:
ext_proj
)
}
let!
(
:cross_reference_note
)
{
let!
(
:cross_reference_note
)
do
create
:note
,
create
:note
,
noteable:
ext_issue
,
project:
ext_proj
,
noteable:
ext_issue
,
project:
ext_proj
,
note:
"mentioned in issue
#{
private_issue
.
to_reference
(
ext_proj
)
}
"
,
note:
"mentioned in issue
#{
private_issue
.
to_reference
(
ext_proj
)
}
"
,
system:
true
system:
true
}
end
before
{
project
.
team
<<
[
user
,
:reporter
]
}
before
{
project
.
team
<<
[
user
,
:reporter
]
}
...
...
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