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
414ae28d
Commit
414ae28d
authored
Mar 30, 2021
by
Huzaifa Iftikhar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang Rubocop offenses for hooks models
parent
fffdd5c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-2
spec/models/hooks/system_hook_spec.rb
spec/models/hooks/system_hook_spec.rb
+2
-2
spec/models/hooks/web_hook_spec.rb
spec/models/hooks/web_hook_spec.rb
+4
-4
No files found.
.rubocop_manual_todo.yml
View file @
414ae28d
...
...
@@ -349,8 +349,6 @@ Rails/SaveBang:
-
'
spec/models/generic_commit_status_spec.rb'
-
'
spec/models/grafana_integration_spec.rb'
-
'
spec/models/group_spec.rb'
-
'
spec/models/hooks/system_hook_spec.rb'
-
'
spec/models/hooks/web_hook_spec.rb'
-
'
spec/models/identity_spec.rb'
-
'
spec/models/issue/metrics_spec.rb'
-
'
spec/models/issue_spec.rb'
...
...
spec/models/hooks/system_hook_spec.rb
View file @
414ae28d
...
...
@@ -56,7 +56,7 @@ RSpec.describe SystemHook do
end
it
"user_destroy hook"
do
user
.
destroy
user
.
destroy
!
expect
(
WebMock
).
to
have_requested
(
:post
,
system_hook
.
url
).
with
(
body:
/user_destroy/
,
...
...
@@ -102,7 +102,7 @@ RSpec.describe SystemHook do
end
it
'group destroy hook'
do
group
.
destroy
group
.
destroy
!
expect
(
WebMock
).
to
have_requested
(
:post
,
system_hook
.
url
).
with
(
body:
/group_destroy/
,
...
...
spec/models/hooks/web_hook_spec.rb
View file @
414ae28d
...
...
@@ -26,7 +26,7 @@ RSpec.describe WebHook do
it
'strips :url before saving it'
do
hook
.
url
=
' https://example.com '
hook
.
save
hook
.
save
!
expect
(
hook
.
url
).
to
eq
(
'https://example.com'
)
end
...
...
@@ -45,14 +45,14 @@ RSpec.describe WebHook do
it
'gets rid of whitespace'
do
hook
.
push_events_branch_filter
=
' branch '
hook
.
save
hook
.
save
!
expect
(
hook
.
push_events_branch_filter
).
to
eq
(
'branch'
)
end
it
'stores whitespace only as empty'
do
hook
.
push_events_branch_filter
=
' '
hook
.
save
hook
.
save
!
expect
(
hook
.
push_events_branch_filter
).
to
eq
(
''
)
end
...
...
@@ -91,7 +91,7 @@ RSpec.describe WebHook do
web_hook
=
create
(
:project_hook
)
create_list
(
:web_hook_log
,
3
,
web_hook:
web_hook
)
expect
{
web_hook
.
destroy
}.
to
change
(
web_hook
.
web_hook_logs
,
:count
).
by
(
-
3
)
expect
{
web_hook
.
destroy
!
}.
to
change
(
web_hook
.
web_hook_logs
,
:count
).
by
(
-
3
)
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