diff options
Diffstat (limited to 'spec/lib/gitlab/email')
9 files changed, 25 insertions, 13 deletions
diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb index 9ff395070ea..585dce331ed 100644 --- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Gitlab::Email::Handler::CreateNoteHandler do it_behaves_like :note_handler_shared_examples do let(:recipient) { sent_notification.recipient } - let(:update_commands_only) { fixture_file('emails/update_commands_only_reply.eml')} + let(:update_commands_only) { fixture_file('emails/update_commands_only_reply.eml') } let(:no_content) { fixture_file('emails/no_content_reply.eml') } let(:commands_in_reply) { fixture_file('emails/commands_in_reply.eml') } let(:with_quick_actions) { fixture_file('emails/valid_reply_with_quick_actions.eml') } @@ -54,7 +54,7 @@ RSpec.describe Gitlab::Email::Handler::CreateNoteHandler do end context 'with a secondary verified email address' do - let(:verified_email) { 'alan@adventuretime.ooo'} + let(:verified_email) { 'alan@adventuretime.ooo' } let(:email_raw) { fixture_file('emails/valid_reply.eml').gsub('jake@adventuretime.ooo', verified_email) } before do diff --git a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb index d0aba70081b..08a7383700b 100644 --- a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb @@ -493,11 +493,19 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do end it 'does not create an issue' do - expect { receiver.execute rescue nil }.not_to change { Issue.count } + expect do + receiver.execute + rescue StandardError + nil + end.not_to change { Issue.count } end it 'does not send thank you email' do - expect { receiver.execute rescue nil }.not_to have_enqueued_job.on_queue('mailers') + expect do + receiver.execute + rescue StandardError + nil + end.not_to have_enqueued_job.on_queue('mailers') end end @@ -532,7 +540,7 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do end context 'service desk is disabled for the project' do - let(:group) { create(:group)} + let(:group) { create(:group) } let(:project) { create(:project, :public, group: group, path: 'test', service_desk_enabled: false) } it 'bounces the email' do @@ -540,7 +548,11 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do end it "doesn't create an issue" do - expect { receiver.execute rescue nil }.not_to change { Issue.count } + expect do + receiver.execute + rescue StandardError + nil + end.not_to change { Issue.count } end end end diff --git a/spec/lib/gitlab/email/message/in_product_marketing/admin_verify_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/admin_verify_spec.rb index b5c3415fe12..7a09feb5b64 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/admin_verify_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/admin_verify_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::AdminVerify do let(:series) { 0 } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe 'public methods' do it 'returns value for series', :aggregate_failures do diff --git a/spec/lib/gitlab/email/message/in_product_marketing/create_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/create_spec.rb index 35470ef3555..d5aec280ea6 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/create_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/create_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Create do let_it_be(:group) { build(:group) } let_it_be(:user) { build(:user) } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe "public methods" do where(series: [0, 1, 2]) diff --git a/spec/lib/gitlab/email/message/in_product_marketing/team_short_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/team_short_spec.rb index daeacef53f6..3ac2076bf35 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/team_short_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/team_short_spec.rb @@ -10,7 +10,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::TeamShort do let(:series) { 0 } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe 'public methods' do it 'returns value for series', :aggregate_failures do diff --git a/spec/lib/gitlab/email/message/in_product_marketing/team_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/team_spec.rb index eca8ba1df00..3354b2ed5cf 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/team_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/team_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Team do let_it_be(:group) { build(:group) } let_it_be(:user) { build(:user) } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe "public methods" do where(series: [0, 1]) diff --git a/spec/lib/gitlab/email/message/in_product_marketing/trial_short_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/trial_short_spec.rb index ebad4672eb3..cf0a119ea80 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/trial_short_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/trial_short_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::TrialShort do let(:series) { 0 } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe 'public methods' do it 'returns value for series', :aggregate_failures do diff --git a/spec/lib/gitlab/email/message/in_product_marketing/trial_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/trial_spec.rb index 3e18b8e35b6..7f86c9a6c6f 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/trial_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/trial_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Trial do let_it_be(:group) { build(:group) } let_it_be(:user) { build(:user) } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe "public methods" do where(series: [0, 1, 2]) diff --git a/spec/lib/gitlab/email/message/in_product_marketing/verify_spec.rb b/spec/lib/gitlab/email/message/in_product_marketing/verify_spec.rb index a7da2e9553d..7e6f62289d2 100644 --- a/spec/lib/gitlab/email/message/in_product_marketing/verify_spec.rb +++ b/spec/lib/gitlab/email/message/in_product_marketing/verify_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Verify do let_it_be(:group) { build(:group) } let_it_be(:user) { build(:user) } - subject(:message) { described_class.new(group: group, user: user, series: series)} + subject(:message) { described_class.new(group: group, user: user, series: series) } describe "public methods" do context 'with series 0' do |