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
0c6c4497
Commit
0c6c4497
authored
Sep 07, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Sep 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses
Fixes Rails/SaveBang cop for spec files
parent
b720d175
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
17 deletions
+19
-17
.rubocop_todo.yml
.rubocop_todo.yml
+0
-3
changelogs/unreleased/rails-save-bang-30.yml
changelogs/unreleased/rails-save-bang-30.yml
+5
-0
spec/requests/api/project_milestones_spec.rb
spec/requests/api/project_milestones_spec.rb
+3
-3
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+9
-9
spec/requests/api/snippets_spec.rb
spec/requests/api/snippets_spec.rb
+2
-2
No files found.
.rubocop_todo.yml
View file @
0c6c4497
...
@@ -1154,9 +1154,6 @@ Rails/SaveBang:
...
@@ -1154,9 +1154,6 @@ Rails/SaveBang:
-
'
spec/requests/api/notes_spec.rb'
-
'
spec/requests/api/notes_spec.rb'
-
'
spec/requests/api/pipeline_schedules_spec.rb'
-
'
spec/requests/api/pipeline_schedules_spec.rb'
-
'
spec/requests/api/project_import_spec.rb'
-
'
spec/requests/api/project_import_spec.rb'
-
'
spec/requests/api/project_milestones_spec.rb'
-
'
spec/requests/api/projects_spec.rb'
-
'
spec/requests/api/snippets_spec.rb'
-
'
spec/requests/git_http_spec.rb'
-
'
spec/requests/git_http_spec.rb'
-
'
spec/requests/lfs_http_spec.rb'
-
'
spec/requests/lfs_http_spec.rb'
-
'
spec/requests/profiles/notifications_controller_spec.rb'
-
'
spec/requests/profiles/notifications_controller_spec.rb'
...
...
changelogs/unreleased/rails-save-bang-30.yml
0 → 100644
View file @
0c6c4497
---
title
:
Fix Rails/SaveBang offenses for 3 files
merge_request
:
41394
author
:
Rajendra Kadam
type
:
other
spec/requests/api/project_milestones_spec.rb
View file @
0c6c4497
...
@@ -43,7 +43,7 @@ RSpec.describe API::ProjectMilestones do
...
@@ -43,7 +43,7 @@ RSpec.describe API::ProjectMilestones do
let
(
:milestones
)
{
[
group_milestone
,
ancestor_group_milestone
,
milestone
,
closed_milestone
]
}
let
(
:milestones
)
{
[
group_milestone
,
ancestor_group_milestone
,
milestone
,
closed_milestone
]
}
before_all
do
before_all
do
project
.
update
(
namespace:
group
)
project
.
update
!
(
namespace:
group
)
end
end
it_behaves_like
'listing all milestones'
it_behaves_like
'listing all milestones'
...
@@ -108,7 +108,7 @@ RSpec.describe API::ProjectMilestones do
...
@@ -108,7 +108,7 @@ RSpec.describe API::ProjectMilestones do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
before
do
before
do
project
.
update
(
namespace:
group
)
project
.
update
!
(
namespace:
group
)
end
end
context
'when user does not have permission to promote milestone'
do
context
'when user does not have permission to promote milestone'
do
...
@@ -163,7 +163,7 @@ RSpec.describe API::ProjectMilestones do
...
@@ -163,7 +163,7 @@ RSpec.describe API::ProjectMilestones do
context
'when project does not belong to group'
do
context
'when project does not belong to group'
do
before
do
before
do
project
.
update
(
namespace:
user
.
namespace
)
project
.
update
!
(
namespace:
user
.
namespace
)
end
end
it
'returns 403'
do
it
'returns 403'
do
...
...
spec/requests/api/projects_spec.rb
View file @
0c6c4497
...
@@ -208,7 +208,7 @@ RSpec.describe API::Projects do
...
@@ -208,7 +208,7 @@ RSpec.describe API::Projects do
end
end
it
'does not include projects marked for deletion'
do
it
'does not include projects marked for deletion'
do
project
.
update
(
pending_delete:
true
)
project
.
update
!
(
pending_delete:
true
)
get
api
(
'/projects'
,
user
)
get
api
(
'/projects'
,
user
)
...
@@ -502,7 +502,7 @@ RSpec.describe API::Projects do
...
@@ -502,7 +502,7 @@ RSpec.describe API::Projects do
before
do
before
do
project_member
project_member
user3
.
update
(
starred_projects:
[
project
,
project2
,
project3
,
public_project
])
user3
.
update
!
(
starred_projects:
[
project
,
project2
,
project3
,
public_project
])
end
end
it
'returns the starred projects viewable by the user'
do
it
'returns the starred projects viewable by the user'
do
...
@@ -523,7 +523,7 @@ RSpec.describe API::Projects do
...
@@ -523,7 +523,7 @@ RSpec.describe API::Projects do
let!
(
:project9
)
{
create
(
:project
,
:public
,
path:
'gitlab9'
)
}
let!
(
:project9
)
{
create
(
:project
,
:public
,
path:
'gitlab9'
)
}
before
do
before
do
user
.
update
(
starred_projects:
[
project5
,
project7
,
project8
,
project9
])
user
.
update
!
(
starred_projects:
[
project5
,
project7
,
project8
,
project9
])
end
end
context
'including owned filter'
do
context
'including owned filter'
do
...
@@ -1232,7 +1232,7 @@ RSpec.describe API::Projects do
...
@@ -1232,7 +1232,7 @@ RSpec.describe API::Projects do
describe
'GET /users/:user_id/starred_projects/'
do
describe
'GET /users/:user_id/starred_projects/'
do
before
do
before
do
user3
.
update
(
starred_projects:
[
project
,
project2
,
project3
])
user3
.
update
!
(
starred_projects:
[
project
,
project2
,
project3
])
end
end
it
'returns error when user not found'
do
it
'returns error when user not found'
do
...
@@ -1745,7 +1745,7 @@ RSpec.describe API::Projects do
...
@@ -1745,7 +1745,7 @@ RSpec.describe API::Projects do
end
end
it
'returns 404 when project is marked for deletion'
do
it
'returns 404 when project is marked for deletion'
do
project
.
update
(
pending_delete:
true
)
project
.
update
!
(
pending_delete:
true
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
...
@@ -2260,7 +2260,7 @@ RSpec.describe API::Projects do
...
@@ -2260,7 +2260,7 @@ RSpec.describe API::Projects do
end
end
it
"returns a 400 error when sharing is disabled"
do
it
"returns a 400 error when sharing is disabled"
do
project
.
namespace
.
update
(
share_with_group_lock:
true
)
project
.
namespace
.
update
!
(
share_with_group_lock:
true
)
post
api
(
"/projects/
#{
project
.
id
}
/share"
,
user
),
params:
{
group_id:
group
.
id
,
group_access:
Gitlab
::
Access
::
DEVELOPER
}
post
api
(
"/projects/
#{
project
.
id
}
/share"
,
user
),
params:
{
group_id:
group
.
id
,
group_access:
Gitlab
::
Access
::
DEVELOPER
}
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
end
end
...
@@ -2417,7 +2417,7 @@ RSpec.describe API::Projects do
...
@@ -2417,7 +2417,7 @@ RSpec.describe API::Projects do
end
end
it
'updates visibility_level from public to private'
do
it
'updates visibility_level from public to private'
do
project3
.
update
({
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
})
project3
.
update
!
({
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
})
project_param
=
{
visibility:
'private'
}
project_param
=
{
visibility:
'private'
}
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user
),
params:
project_param
put
api
(
"/projects/
#{
project3
.
id
}
"
,
user
),
params:
project_param
...
@@ -2877,8 +2877,8 @@ RSpec.describe API::Projects do
...
@@ -2877,8 +2877,8 @@ RSpec.describe API::Projects do
let
(
:private_user
)
{
create
(
:user
,
private_profile:
true
)
}
let
(
:private_user
)
{
create
(
:user
,
private_profile:
true
)
}
before
do
before
do
user
.
update
(
starred_projects:
[
public_project
])
user
.
update
!
(
starred_projects:
[
public_project
])
private_user
.
update
(
starred_projects:
[
public_project
])
private_user
.
update
!
(
starred_projects:
[
public_project
])
end
end
it
'returns not_found(404) for not existing project'
do
it
'returns not_found(404) for not existing project'
do
...
...
spec/requests/api/snippets_spec.rb
View file @
0c6c4497
...
@@ -111,7 +111,7 @@ RSpec.describe API::Snippets do
...
@@ -111,7 +111,7 @@ RSpec.describe API::Snippets do
end
end
it
'returns 404 for invalid snippet id'
do
it
'returns 404 for invalid snippet id'
do
snippet
.
destroy
snippet
.
destroy
!
get
api
(
"/snippets/
#{
snippet
.
id
}
/raw"
,
author
)
get
api
(
"/snippets/
#{
snippet
.
id
}
/raw"
,
author
)
...
@@ -201,7 +201,7 @@ RSpec.describe API::Snippets do
...
@@ -201,7 +201,7 @@ RSpec.describe API::Snippets do
end
end
it
'returns 404 for invalid snippet id'
do
it
'returns 404 for invalid snippet id'
do
private_snippet
.
destroy
private_snippet
.
destroy
!
subject
subject
...
...
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