Commit 7376f0aa authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix Rails/SaveBang offenses

Fixes Rails/SaveBang cop for spec files in spec/services/milestones/*
parent e342d150
...@@ -1144,9 +1144,6 @@ Rails/SaveBang: ...@@ -1144,9 +1144,6 @@ Rails/SaveBang:
- 'spec/services/issuable/clone/attributes_rewriter_spec.rb' - 'spec/services/issuable/clone/attributes_rewriter_spec.rb'
- 'spec/services/issuable/common_system_notes_service_spec.rb' - 'spec/services/issuable/common_system_notes_service_spec.rb'
- 'spec/services/labels/promote_service_spec.rb' - 'spec/services/labels/promote_service_spec.rb'
- 'spec/services/milestones/destroy_service_spec.rb'
- 'spec/services/milestones/promote_service_spec.rb'
- 'spec/services/milestones/transfer_service_spec.rb'
- 'spec/services/notes/create_service_spec.rb' - 'spec/services/notes/create_service_spec.rb'
- 'spec/services/notification_recipients/build_service_spec.rb' - 'spec/services/notification_recipients/build_service_spec.rb'
- 'spec/services/notification_service_spec.rb' - 'spec/services/notification_service_spec.rb'
......
---
title: Fix Rails/SaveBang offenses for spec files in spec/services/milestones/*
merge_request: 42775
author: Rajendra Kadam
type: other
...@@ -45,7 +45,7 @@ RSpec.describe Milestones::DestroyService do ...@@ -45,7 +45,7 @@ RSpec.describe Milestones::DestroyService do
let(:group_milestone) { create(:milestone, group: group) } let(:group_milestone) { create(:milestone, group: group) }
before do before do
project.update(namespace: group) project.update!(namespace: group)
group.add_developer(user) group.add_developer(user)
end end
......
...@@ -23,7 +23,7 @@ RSpec.describe Milestones::PromoteService do ...@@ -23,7 +23,7 @@ RSpec.describe Milestones::PromoteService do
end end
it 'raises error if project does not belong to a group' do it 'raises error if project does not belong to a group' do
project.update(namespace: user.namespace) project.update!(namespace: user.namespace)
expect { service.execute(milestone) }.to raise_error(described_class::PromoteMilestoneError) expect { service.execute(milestone) }.to raise_error(described_class::PromoteMilestoneError)
end end
......
...@@ -23,7 +23,7 @@ RSpec.describe Milestones::TransferService do ...@@ -23,7 +23,7 @@ RSpec.describe Milestones::TransferService do
new_group.add_maintainer(user) new_group.add_maintainer(user)
project.add_maintainer(user) project.add_maintainer(user)
# simulate project transfer # simulate project transfer
project.update(group: new_group) project.update!(group: new_group)
end end
context 'without existing milestone at the new group level' do context 'without existing milestone at the new group level' 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