Commit c6d22b35 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Rémy Coutable

Fix Rails/SaveBang offenses for spec/serializers/*

parent 7e0e3508
......@@ -1208,11 +1208,6 @@ Rails/SaveBang:
- 'spec/requests/lfs_http_spec.rb'
- 'spec/requests/profiles/notifications_controller_spec.rb'
- 'spec/requests/projects/cycle_analytics_events_spec.rb'
- 'spec/serializers/environment_status_entity_spec.rb'
- 'spec/serializers/issue_entity_spec.rb'
- 'spec/serializers/job_entity_spec.rb'
- 'spec/serializers/merge_request_poll_widget_entity_spec.rb'
- 'spec/serializers/merge_request_widget_entity_spec.rb'
- 'spec/services/auth/container_registry_authentication_service_spec.rb'
- 'spec/services/auto_merge/base_service_spec.rb'
- 'spec/services/auto_merge_service_spec.rb'
......
---
title: Fix Rails/SaveBang offenses for spec/serializers/*
merge_request: 41309
author: Rajendra Kadam
type: fixed
......@@ -17,7 +17,7 @@ RSpec.describe EnvironmentStatusEntity do
subject { entity.as_json }
before do
deployment.update(sha: merge_request.diff_head_sha)
deployment.update!(sha: merge_request.diff_head_sha)
allow(request).to receive(:current_user).and_return(user)
end
......
......@@ -112,7 +112,7 @@ RSpec.describe IssueEntity do
context 'when project is archived' do
before do
project.update(archived: true)
project.update!(archived: true)
end
it 'returns archived true' do
......
......@@ -45,7 +45,7 @@ RSpec.describe JobEntity do
context 'when job is retryable' do
before do
job.update(status: :failed)
job.update!(status: :failed)
end
it 'contains cancel path' do
......@@ -55,7 +55,7 @@ RSpec.describe JobEntity do
context 'when job is cancelable' do
before do
job.update(status: :running)
job.update!(status: :running)
end
it 'contains cancel path' do
......
......@@ -265,7 +265,7 @@ RSpec.describe MergeRequestPollWidgetEntity do
context 'when is not up to date' do
it 'returns nil' do
pipeline.update(sha: "not up to date")
pipeline.update!(sha: "not up to date")
expect(subject[:pipeline]).to eq(nil)
end
......
......@@ -210,7 +210,7 @@ RSpec.describe MergeRequestWidgetEntity do
context 'when build feature is disabled' do
before do
project.project_feature.update(builds_access_level: ProjectFeature::DISABLED)
project.project_feature.update!(builds_access_level: ProjectFeature::DISABLED)
end
it 'has no path' do
......@@ -346,7 +346,7 @@ RSpec.describe MergeRequestWidgetEntity do
it 'returns a blank rebase_path' do
allow(merge_request).to receive(:should_be_rebased?).and_return(true)
forked_project.destroy
forked_project.destroy!
merge_request.reload
entity = described_class.new(merge_request, request: request).as_json
......
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