Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-04-03 03:09:13 +00:00
parent 4d6582cc54
commit 52591f253b
5 changed files with 12 additions and 9 deletions

View file

@ -300,8 +300,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'

View file

@ -0,0 +1,5 @@
---
title: Fix Rails/SaveBang Rubocop offenses for hooks module
merge_request: 57918
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed

View file

@ -285,7 +285,7 @@ For example, to add support for files referenced by a `Widget` model with a
t.integer :verification_state, default: 0, null: false, limit: 2
t.integer :retry_count, default: 0, limit: 2
t.integer :verification_retry_count, default: 0, limit: 2
t.boolean :checksum_mismatch
t.boolean :checksum_mismatch, default: false, null: false
t.binary :verification_checksum
t.binary :verification_checksum_mismatched
t.string :verification_failure, limit: 255

View file

@ -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/,

View file

@ -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