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
17cec627
Commit
17cec627
authored
Sep 08, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses
Fixes Rails/SaveBang cop for spec files
parent
3c96d96d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
.rubocop_todo.yml
.rubocop_todo.yml
+0
-3
changelogs/unreleased/rails-save-bang-31.yml
changelogs/unreleased/rails-save-bang-31.yml
+5
-0
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+11
-11
spec/requests/api/notes_spec.rb
spec/requests/api/notes_spec.rb
+2
-2
No files found.
.rubocop_todo.yml
View file @
17cec627
...
@@ -1132,9 +1132,6 @@ Rails/SaveBang:
...
@@ -1132,9 +1132,6 @@ Rails/SaveBang:
-
'
spec/requests/api/issues/post_projects_issues_spec.rb'
-
'
spec/requests/api/issues/post_projects_issues_spec.rb'
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/requests/api/labels_spec.rb'
-
'
spec/requests/api/labels_spec.rb'
-
'
spec/requests/api/merge_requests_spec.rb'
-
'
spec/requests/api/notes_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/git_http_spec.rb'
-
'
spec/requests/git_http_spec.rb'
-
'
spec/requests/lfs_http_spec.rb'
-
'
spec/requests/lfs_http_spec.rb'
...
...
changelogs/unreleased/rails-save-bang-31.yml
0 → 100644
View file @
17cec627
---
title
:
Fix Rails/SaveBang offenses for 3 files
merge_request
:
41395
author
:
Rajendra Kadam
type
:
other
spec/requests/api/merge_requests_spec.rb
View file @
17cec627
...
@@ -912,7 +912,7 @@ RSpec.describe API::MergeRequests do
...
@@ -912,7 +912,7 @@ RSpec.describe API::MergeRequests do
let
(
:parent_group
)
{
create
(
:group
)
}
let
(
:parent_group
)
{
create
(
:group
)
}
before
do
before
do
group
.
update
(
parent_id:
parent_group
.
id
)
group
.
update
!
(
parent_id:
parent_group
.
id
)
merge_request_merged
.
reload
merge_request_merged
.
reload
end
end
...
@@ -1027,7 +1027,7 @@ RSpec.describe API::MergeRequests do
...
@@ -1027,7 +1027,7 @@ RSpec.describe API::MergeRequests do
let
(
:non_member
)
{
create
(
:user
)
}
let
(
:non_member
)
{
create
(
:user
)
}
before
do
before
do
merge_request
.
update
(
author:
non_member
)
merge_request
.
update
!
(
author:
non_member
)
end
end
it
'exposes first_contribution as true'
do
it
'exposes first_contribution as true'
do
...
@@ -1084,8 +1084,8 @@ RSpec.describe API::MergeRequests do
...
@@ -1084,8 +1084,8 @@ RSpec.describe API::MergeRequests do
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
author:
user
,
source_project:
project
,
source_branch:
'markdown'
,
title:
"Test"
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:simple
,
author:
user
,
source_project:
project
,
source_branch:
'markdown'
,
title:
"Test"
)
}
before
do
before
do
merge_request
.
update
(
head_pipeline:
create
(
:ci_pipeline
))
merge_request
.
update
!
(
head_pipeline:
create
(
:ci_pipeline
))
merge_request
.
project
.
project_feature
.
update
(
builds_access_level:
10
)
merge_request
.
project
.
project_feature
.
update
!
(
builds_access_level:
10
)
end
end
context
'when user can read the pipeline'
do
context
'when user can read the pipeline'
do
...
@@ -1691,7 +1691,7 @@ RSpec.describe API::MergeRequests do
...
@@ -1691,7 +1691,7 @@ RSpec.describe API::MergeRequests do
end
end
it
'returns 403 when target project has disabled merge requests'
do
it
'returns 403 when target project has disabled merge requests'
do
project
.
project_feature
.
update
(
merge_requests_access_level:
0
)
project
.
project_feature
.
update
!
(
merge_requests_access_level:
0
)
post
api
(
"/projects/
#{
forked_project
.
id
}
/merge_requests"
,
user2
),
post
api
(
"/projects/
#{
forked_project
.
id
}
/merge_requests"
,
user2
),
params:
{
params:
{
...
@@ -2146,7 +2146,7 @@ RSpec.describe API::MergeRequests do
...
@@ -2146,7 +2146,7 @@ RSpec.describe API::MergeRequests do
let
(
:source_branch
)
{
merge_request
.
source_branch
}
let
(
:source_branch
)
{
merge_request
.
source_branch
}
before
do
before
do
merge_request
.
update
(
merge_params:
{
'force_remove_source_branch'
=>
true
})
merge_request
.
update
!
(
merge_params:
{
'force_remove_source_branch'
=>
true
})
end
end
it
'removes the source branch'
do
it
'removes the source branch'
do
...
@@ -2173,7 +2173,7 @@ RSpec.describe API::MergeRequests do
...
@@ -2173,7 +2173,7 @@ RSpec.describe API::MergeRequests do
let
(
:merge_request
)
{
create
(
:merge_request
,
:rebased
,
source_project:
project
,
squash:
true
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:rebased
,
source_project:
project
,
squash:
true
)
}
before
do
before
do
project
.
update
(
merge_requests_ff_only_enabled:
true
)
project
.
update
!
(
merge_requests_ff_only_enabled:
true
)
end
end
it
"records the squash commit SHA and returns it in the response"
do
it
"records the squash commit SHA and returns it in the response"
do
...
@@ -2263,7 +2263,7 @@ RSpec.describe API::MergeRequests do
...
@@ -2263,7 +2263,7 @@ RSpec.describe API::MergeRequests do
describe
"PUT /projects/:id/merge_requests/:merge_request_iid"
do
describe
"PUT /projects/:id/merge_requests/:merge_request_iid"
do
context
'updates force_remove_source_branch properly'
do
context
'updates force_remove_source_branch properly'
do
it
'sets to false'
do
it
'sets to false'
do
merge_request
.
update
(
merge_params:
{
'force_remove_source_branch'
=>
true
}
)
merge_request
.
update
!
(
merge_params:
{
'force_remove_source_branch'
=>
true
}
)
expect
(
merge_request
.
force_remove_source_branch?
).
to
be_truthy
expect
(
merge_request
.
force_remove_source_branch?
).
to
be_truthy
...
@@ -2275,7 +2275,7 @@ RSpec.describe API::MergeRequests do
...
@@ -2275,7 +2275,7 @@ RSpec.describe API::MergeRequests do
end
end
it
'sets to true'
do
it
'sets to true'
do
merge_request
.
update
(
merge_params:
{
'force_remove_source_branch'
=>
false
}
)
merge_request
.
update
!
(
merge_params:
{
'force_remove_source_branch'
=>
false
}
)
expect
(
merge_request
.
force_remove_source_branch?
).
to
be_falsey
expect
(
merge_request
.
force_remove_source_branch?
).
to
be_falsey
...
@@ -2760,7 +2760,7 @@ RSpec.describe API::MergeRequests do
...
@@ -2760,7 +2760,7 @@ RSpec.describe API::MergeRequests do
merge_request
merge_request
merge_request
.
created_at
+=
1
.
hour
merge_request
.
created_at
+=
1
.
hour
merge_request
.
updated_at
+=
30
.
minutes
merge_request
.
updated_at
+=
30
.
minutes
merge_request
.
save
merge_request
.
save
!
merge_request
merge_request
end
end
...
@@ -2768,7 +2768,7 @@ RSpec.describe API::MergeRequests do
...
@@ -2768,7 +2768,7 @@ RSpec.describe API::MergeRequests do
merge_request_closed
merge_request_closed
merge_request_closed
.
created_at
-=
1
.
hour
merge_request_closed
.
created_at
-=
1
.
hour
merge_request_closed
.
updated_at
-=
30
.
minutes
merge_request_closed
.
updated_at
-=
30
.
minutes
merge_request_closed
.
save
merge_request_closed
.
save
!
merge_request_closed
merge_request_closed
end
end
end
end
spec/requests/api/notes_spec.rb
View file @
17cec627
...
@@ -81,7 +81,7 @@ RSpec.describe API::Notes do
...
@@ -81,7 +81,7 @@ RSpec.describe API::Notes do
context
"issue is confidential"
do
context
"issue is confidential"
do
before
do
before
do
ext_issue
.
update
(
confidential:
true
)
ext_issue
.
update
!
(
confidential:
true
)
end
end
it
"returns 404"
do
it
"returns 404"
do
...
@@ -183,7 +183,7 @@ RSpec.describe API::Notes do
...
@@ -183,7 +183,7 @@ RSpec.describe API::Notes do
context
"when issue is confidential"
do
context
"when issue is confidential"
do
before
do
before
do
issue
.
update
(
confidential:
true
)
issue
.
update
!
(
confidential:
true
)
end
end
it
"returns 404"
do
it
"returns 404"
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