Commit c293c5e4 authored by Kerri Miller's avatar Kerri Miller

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

Fix Rails/SaveBang offenses in ee/spec/mailers

See merge request gitlab-org/gitlab!58097
parents 23530779 22db34b0
...@@ -60,7 +60,6 @@ Rails/SaveBang: ...@@ -60,7 +60,6 @@ Rails/SaveBang:
- 'ee/spec/lib/gitlab/git_access_spec.rb' - 'ee/spec/lib/gitlab/git_access_spec.rb'
- 'ee/spec/lib/gitlab/import_export/group/relation_factory_spec.rb' - 'ee/spec/lib/gitlab/import_export/group/relation_factory_spec.rb'
- 'ee/spec/lib/gitlab/mirror_spec.rb' - 'ee/spec/lib/gitlab/mirror_spec.rb'
- 'ee/spec/mailers/notify_spec.rb'
- 'ee/spec/models/application_setting_spec.rb' - 'ee/spec/models/application_setting_spec.rb'
- 'ee/spec/models/approval_merge_request_rule_spec.rb' - 'ee/spec/models/approval_merge_request_rule_spec.rb'
- 'ee/spec/models/approval_project_rule_spec.rb' - 'ee/spec/models/approval_project_rule_spec.rb'
......
---
title: Fix Rails/SaveBang rubocop offenses in ee/spec/mailers
merge_request: 58097
author: Abdul Wadood @abdulwd
type: fixed
...@@ -93,8 +93,8 @@ RSpec.describe Notify do ...@@ -93,8 +93,8 @@ RSpec.describe Notify do
subject { described_class.approved_merge_request_email(recipient.id, merge_request.id, last_approver.id) } subject { described_class.approved_merge_request_email(recipient.id, merge_request.id, last_approver.id) }
before do before do
merge_request.approvals.create(user: assignee) merge_request.approvals.create!(user: assignee)
merge_request.approvals.create(user: last_approver) merge_request.approvals.create!(user: last_approver)
end end
it_behaves_like 'a multiple recipients email' it_behaves_like 'a multiple recipients email'
...@@ -141,7 +141,7 @@ RSpec.describe Notify do ...@@ -141,7 +141,7 @@ RSpec.describe Notify do
context 'when merge request has no assignee' do context 'when merge request has no assignee' do
before do before do
merge_request.update(assignees: []) merge_request.update!(assignees: [])
end end
it 'does not show the assignee' do it 'does not show the assignee' do
...@@ -156,7 +156,7 @@ RSpec.describe Notify do ...@@ -156,7 +156,7 @@ RSpec.describe Notify do
subject { described_class.unapproved_merge_request_email(recipient.id, merge_request.id, last_unapprover.id) } subject { described_class.unapproved_merge_request_email(recipient.id, merge_request.id, last_unapprover.id) }
before do before do
merge_request.approvals.create(user: assignee) merge_request.approvals.create!(user: assignee)
end end
it_behaves_like 'a multiple recipients email' it_behaves_like 'a multiple recipients email'
...@@ -209,10 +209,6 @@ RSpec.describe Notify do ...@@ -209,10 +209,6 @@ RSpec.describe Notify do
subject { described_class.unapproved_merge_request_email(recipient.id, merge_request_without_assignee.id, last_unapprover.id) } subject { described_class.unapproved_merge_request_email(recipient.id, merge_request_without_assignee.id, last_unapprover.id) }
before do
merge_request_without_assignee.approvals.create(user: merge_request_without_assignee.assignees.first)
end
it 'contains the new status' do it 'contains the new status' do
is_expected.to have_body_text('unapproved') is_expected.to have_body_text('unapproved')
end 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