Commit 09d673ad authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rails-save-bang-ee-spec-support' into 'master'

Fix Rails/SaveBang offenses in ee/spec/support

See merge request gitlab-org/gitlab!58074
parents b48895f6 29db009e
......@@ -126,12 +126,6 @@ Rails/SaveBang:
- 'ee/spec/services/status_page/trigger_publish_service_spec.rb'
- 'ee/spec/services/todo_service_spec.rb'
- 'ee/spec/services/vulnerability_feedback/create_service_spec.rb'
- 'ee/spec/support/protected_tags/access_control_shared_examples.rb'
- 'ee/spec/support/shared_examples/features/protected_branches_access_control_shared_examples.rb'
- 'ee/spec/support/shared_examples/finders/geo/framework_registry_finder_shared_examples.rb'
- 'ee/spec/support/shared_examples/graphql/geo/geo_registries_resolver_shared_examples.rb'
- 'ee/spec/support/shared_examples/lib/analytics/common_merge_request_metrics_refresh_shared_examples.rb'
- 'ee/spec/support/shared_examples/policies/protected_environments_shared_examples.rb'
- 'qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_over_http_spec.rb'
- 'qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb'
- 'qa/qa/specs/features/ee/browser_ui/3_create/repository/pull_mirroring_over_http_spec.rb'
......
---
title: Fix Rails/SaveBang rubocop offenses in ee/spec/support
merge_request: 58074
author: Abdul Wadood @abdulwd
type: fixed
......@@ -7,7 +7,7 @@ RSpec.shared_examples "protected tags > access control > EE" do
before do
users.each { |user| project.add_developer(user) }
groups.each { |group| project.project_group_links.create(group: group, group_access: Gitlab::Access::DEVELOPER) }
groups.each { |group| project.project_group_links.create!(group: group, group_access: Gitlab::Access::DEVELOPER) }
end
def access_levels
......
......@@ -11,7 +11,7 @@ RSpec.shared_examples "protected branches > access control > EE" do
before do
users.each { |user| project.add_developer(user) }
groups.each { |group| project.project_group_links.create(group: group, group_access: Gitlab::Access::DEVELOPER) }
groups.each { |group| project.project_group_links.create(group: group, group_access: Gitlab::Access::DEVELOPER) } # rubocop:disable Rails/SaveBang
end
def last_access_levels(git_operation)
......
......@@ -3,9 +3,12 @@
RSpec.shared_examples 'a framework registry finder' do |registry_factory|
include ::EE::GeoHelpers
# rubocop:disable Rails/SaveBang
let!(:registry1) { create(registry_factory) }
let!(:registry2) { create(registry_factory) }
let!(:registry3) { create(registry_factory) }
# rubocop:enable Rails/SaveBang
let(:params) { {} }
subject(:registries) { described_class.new(user, params).execute }
......
......@@ -6,9 +6,11 @@ RSpec.shared_examples_for 'a Geo registries resolver' do |registry_factory_name|
describe '#resolve' do
let_it_be(:secondary) { create(:geo_node) }
# rubocop:disable Rails/SaveBang
let_it_be(:registry1) { create(registry_factory_name) }
let_it_be(:registry2) { create(registry_factory_name) }
let_it_be(:registry3) { create(registry_factory_name) }
# rubocop:enable Rails/SaveBang
let(:registries) { [registry1, registry2, registry3] }
let(:gql_context) { { current_user: current_user } }
......
......@@ -16,7 +16,7 @@ RSpec.shared_examples 'common merge request metric refresh for' do |metric_name|
context "when #{metric_name} is already present" do
before do
merge_request.metrics.update(metric_name => calculated_value - 10)
merge_request.metrics.update!(metric_name => calculated_value - 10)
end
it "does not change #{metric_name}" do
......@@ -36,7 +36,7 @@ RSpec.shared_examples 'common merge request metric refresh for' do |metric_name|
context 'when no merge request metric is present' do
before do
merge_request.metrics.destroy
merge_request.metrics.destroy!
merge_request.reload
end
......
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