Commit c6249a9e authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rails-save-bang-17' into 'master'

Fix Rails/SaveBang offenses for spec/serializers/*

See merge request gitlab-org/gitlab!41309
parents 571fbce5 c6d22b35
...@@ -1205,11 +1205,6 @@ Rails/SaveBang: ...@@ -1205,11 +1205,6 @@ Rails/SaveBang:
- 'spec/requests/lfs_http_spec.rb' - 'spec/requests/lfs_http_spec.rb'
- 'spec/requests/profiles/notifications_controller_spec.rb' - 'spec/requests/profiles/notifications_controller_spec.rb'
- 'spec/requests/projects/cycle_analytics_events_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/auth/container_registry_authentication_service_spec.rb'
- 'spec/services/auto_merge/base_service_spec.rb' - 'spec/services/auto_merge/base_service_spec.rb'
- 'spec/services/auto_merge_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 ...@@ -17,7 +17,7 @@ RSpec.describe EnvironmentStatusEntity do
subject { entity.as_json } subject { entity.as_json }
before do 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) allow(request).to receive(:current_user).and_return(user)
end end
......
...@@ -112,7 +112,7 @@ RSpec.describe IssueEntity do ...@@ -112,7 +112,7 @@ RSpec.describe IssueEntity do
context 'when project is archived' do context 'when project is archived' do
before do before do
project.update(archived: true) project.update!(archived: true)
end end
it 'returns archived true' do it 'returns archived true' do
......
...@@ -45,7 +45,7 @@ RSpec.describe JobEntity do ...@@ -45,7 +45,7 @@ RSpec.describe JobEntity do
context 'when job is retryable' do context 'when job is retryable' do
before do before do
job.update(status: :failed) job.update!(status: :failed)
end end
it 'contains cancel path' do it 'contains cancel path' do
...@@ -55,7 +55,7 @@ RSpec.describe JobEntity do ...@@ -55,7 +55,7 @@ RSpec.describe JobEntity do
context 'when job is cancelable' do context 'when job is cancelable' do
before do before do
job.update(status: :running) job.update!(status: :running)
end end
it 'contains cancel path' do it 'contains cancel path' do
......
...@@ -265,7 +265,7 @@ RSpec.describe MergeRequestPollWidgetEntity do ...@@ -265,7 +265,7 @@ RSpec.describe MergeRequestPollWidgetEntity do
context 'when is not up to date' do context 'when is not up to date' do
it 'returns nil' 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) expect(subject[:pipeline]).to eq(nil)
end end
......
...@@ -210,7 +210,7 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -210,7 +210,7 @@ RSpec.describe MergeRequestWidgetEntity do
context 'when build feature is disabled' do context 'when build feature is disabled' do
before do before do
project.project_feature.update(builds_access_level: ProjectFeature::DISABLED) project.project_feature.update!(builds_access_level: ProjectFeature::DISABLED)
end end
it 'has no path' do it 'has no path' do
...@@ -346,7 +346,7 @@ RSpec.describe MergeRequestWidgetEntity do ...@@ -346,7 +346,7 @@ RSpec.describe MergeRequestWidgetEntity do
it 'returns a blank rebase_path' do it 'returns a blank rebase_path' do
allow(merge_request).to receive(:should_be_rebased?).and_return(true) allow(merge_request).to receive(:should_be_rebased?).and_return(true)
forked_project.destroy forked_project.destroy!
merge_request.reload merge_request.reload
entity = described_class.new(merge_request, request: request).as_json 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