Commit 5b2e81f6 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Replace set with let_it_be in spec/mailers

Removes usage of `set` in specs
parent 8a4b8776
...@@ -7,8 +7,8 @@ describe Emails::PagesDomains do ...@@ -7,8 +7,8 @@ describe Emails::PagesDomains do
include EmailSpec::Matchers include EmailSpec::Matchers
include_context 'gitlab email notification' include_context 'gitlab email notification'
set(:domain) { create(:pages_domain, project: project) } let_it_be(:domain, reload: true) { create(:pages_domain, project: project) }
set(:user) { project.creator } let_it_be(:user) { project.creator }
shared_examples 'a pages domain email' do shared_examples 'a pages domain email' do
let(:recipient) { user } let(:recipient) { user }
......
...@@ -6,7 +6,7 @@ require 'email_spec' ...@@ -6,7 +6,7 @@ require 'email_spec'
describe Emails::Pipelines do describe Emails::Pipelines do
include EmailSpec::Matchers include EmailSpec::Matchers
set(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
shared_examples_for 'correct pipeline information' do shared_examples_for 'correct pipeline information' do
it 'has a correct information' do it 'has a correct information' do
......
...@@ -13,11 +13,11 @@ describe Notify do ...@@ -13,11 +13,11 @@ describe Notify do
let(:current_user_sanitized) { 'www_example_com' } let(:current_user_sanitized) { 'www_example_com' }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:current_user) { create(:user, email: "current@email.com", name: 'www.example.com') } let_it_be(:current_user) { create(:user, email: "current@email.com", name: 'www.example.com') }
set(:assignee) { create(:user, email: 'assignee@example.com', name: 'John Doe') } let_it_be(:assignee) { create(:user, email: 'assignee@example.com', name: 'John Doe') }
set(:merge_request) do let_it_be(:merge_request) do
create(:merge_request, source_project: project, create(:merge_request, source_project: project,
target_project: project, target_project: project,
author: current_user, author: current_user,
...@@ -25,7 +25,7 @@ describe Notify do ...@@ -25,7 +25,7 @@ describe Notify do
description: 'Awesome description') description: 'Awesome description')
end end
set(:issue) do let_it_be(:issue, reload: true) do
create(:issue, author: current_user, create(:issue, author: current_user,
assignees: [assignee], assignees: [assignee],
project: project, project: project,
...@@ -487,7 +487,7 @@ describe Notify do ...@@ -487,7 +487,7 @@ describe Notify do
end end
describe 'that are unmergeable' do describe 'that are unmergeable' do
set(:merge_request) do let_it_be(:merge_request) do
create(:merge_request, :conflict, create(:merge_request, :conflict,
source_project: project, source_project: project,
target_project: project, target_project: project,
...@@ -568,7 +568,7 @@ describe Notify do ...@@ -568,7 +568,7 @@ describe Notify do
end end
describe '#mail_thread' do describe '#mail_thread' do
set(:mail_thread_note) { create(:note) } let_it_be(:mail_thread_note) { create(:note) }
let(:headers) do let(:headers) do
{ {
...@@ -638,9 +638,9 @@ describe Notify do ...@@ -638,9 +638,9 @@ describe Notify do
let(:host) { Gitlab.config.gitlab.host } let(:host) { Gitlab.config.gitlab.host }
context 'in discussion' do context 'in discussion' do
set(:first_note) { create(:discussion_note_on_issue, project: project) } let_it_be(:first_note) { create(:discussion_note_on_issue, project: project) }
set(:second_note) { create(:discussion_note_on_issue, in_reply_to: first_note, project: project) } let_it_be(:second_note) { create(:discussion_note_on_issue, in_reply_to: first_note, project: project) }
set(:third_note) { create(:discussion_note_on_issue, in_reply_to: second_note, project: project) } let_it_be(:third_note) { create(:discussion_note_on_issue, in_reply_to: second_note, project: project) }
subject { described_class.note_issue_email(recipient.id, third_note.id) } subject { described_class.note_issue_email(recipient.id, third_note.id) }
...@@ -664,7 +664,7 @@ describe Notify do ...@@ -664,7 +664,7 @@ describe Notify do
end end
context 'individual issue comments' do context 'individual issue comments' do
set(:note) { create(:note_on_issue, project: project) } let_it_be(:note) { create(:note_on_issue, project: project) }
subject { described_class.note_issue_email(recipient.id, note.id) } subject { described_class.note_issue_email(recipient.id, note.id) }
......
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