Commit 5349abb2 authored by Markus Koller's avatar Markus Koller

Merge branch 'issue_220040_14' into 'master'

Fix Rails/SaveBang offenses

See merge request gitlab-org/gitlab!75976
parents 4a36c773 9ee72296
......@@ -31,11 +31,6 @@ Rails/SaveBang:
- spec/lib/gitlab/database/custom_structure_spec.rb
- spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb
- spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
- spec/lib/gitlab/gfm/reference_rewriter_spec.rb
- spec/lib/gitlab/git_access_spec.rb
- spec/lib/gitlab/import_export/avatar_saver_spec.rb
- spec/lib/gitlab/import_export/base/relation_factory_spec.rb
- spec/lib/gitlab/import_export/design_repo_restorer_spec.rb
- spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb
- spec/lib/gitlab/import_export/fork_spec.rb
- spec/lib/gitlab/import_export/group/legacy_tree_saver_spec.rb
......
......@@ -92,7 +92,7 @@ RSpec.describe Gitlab::Gfm::ReferenceRewriter do
let!(:group_label) { create(:group_label, id: 321, name: 'group label', group: old_group) }
before do
old_project.update(namespace: old_group)
old_project.update!(namespace: old_group)
end
context 'label referenced by id' do
......
......@@ -96,7 +96,7 @@ RSpec.describe Gitlab::GitAccess do
context 'when the DeployKey has access to the project' do
before do
deploy_key.deploy_keys_projects.create(project: project, can_push: true)
deploy_key.deploy_keys_projects.create!(project: project, can_push: true)
end
it 'allows push and pull access' do
......@@ -820,7 +820,7 @@ RSpec.describe Gitlab::GitAccess do
project.add_role(user, role)
end
protected_branch.save
protected_branch.save!
aggregate_failures do
matrix.each do |action, allowed|
......@@ -1090,7 +1090,7 @@ RSpec.describe Gitlab::GitAccess do
context 'when deploy_key can push' do
context 'when project is authorized' do
before do
key.deploy_keys_projects.create(project: project, can_push: true)
key.deploy_keys_projects.create!(project: project, can_push: true)
end
it { expect { push_access_check }.not_to raise_error }
......@@ -1120,7 +1120,7 @@ RSpec.describe Gitlab::GitAccess do
context 'when deploy_key cannot push' do
context 'when project is authorized' do
before do
key.deploy_keys_projects.create(project: project, can_push: false)
key.deploy_keys_projects.create!(project: project, can_push: false)
end
it { expect { push_access_check }.to raise_forbidden(described_class::ERROR_MESSAGES[:deploy_key_upload]) }
......
......@@ -20,7 +20,7 @@ RSpec.describe Gitlab::ImportExport::AvatarSaver do
end
it 'saves a project avatar' do
described_class.new(project: project_with_avatar, shared: shared).save
described_class.new(project: project_with_avatar, shared: shared).save # rubocop:disable Rails/SaveBang
expect(File).to exist(Dir["#{shared.export_path}/avatar/**/dk.png"].first)
end
......
......@@ -11,7 +11,7 @@ RSpec.describe Gitlab::ImportExport::Base::RelationFactory do
let(:excluded_keys) { [] }
subject do
described_class.create(relation_sym: relation_sym,
described_class.create(relation_sym: relation_sym, # rubocop:disable Rails/SaveBang
relation_hash: relation_hash,
relation_index: 1,
object_builder: Gitlab::ImportExport::Project::ObjectBuilder,
......
......@@ -24,7 +24,7 @@ RSpec.describe Gitlab::ImportExport::DesignRepoRestorer do
allow(instance).to receive(:storage_path).and_return(export_path)
end
bundler.save
bundler.save # rubocop:disable Rails/SaveBang
end
after do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment