diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-08-02 19:43:51 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-08-03 16:55:48 +0300 |
commit | bb5f79d43e0bb20bacd5ecd8b66832d9857bd079 (patch) | |
tree | b480f8496e3e93e5a845e4a710e2d46901871413 /spec/workers/emails_on_push_worker_spec.rb | |
parent | b0464fa4e19e187adc46ec054ccd68832faec08c (diff) |
Don't include EmailHelpers manually, pick with rspec
`:mailer` is needed to pick it easily, while
`type: :mailer` is needed for picking it automatically for
tests located in spec/mailers/*_spec.rb
It's a bit complicated in spec/services/notification_service_spec.rb
but we'll leave it alone for now.
Diffstat (limited to 'spec/workers/emails_on_push_worker_spec.rb')
-rw-r--r-- | spec/workers/emails_on_push_worker_spec.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/spec/workers/emails_on_push_worker_spec.rb b/spec/workers/emails_on_push_worker_spec.rb index 5b6b38e0f76..318aad4bc1e 100644 --- a/spec/workers/emails_on_push_worker_spec.rb +++ b/spec/workers/emails_on_push_worker_spec.rb @@ -1,8 +1,7 @@ require 'spec_helper' -describe EmailsOnPushWorker do +describe EmailsOnPushWorker, :mailer do include RepoHelpers - include EmailHelpers include EmailSpec::Matchers let(:project) { create(:project, :repository) } @@ -90,7 +89,6 @@ describe EmailsOnPushWorker do context "when there is an SMTP error" do before do - reset_delivered_emails! allow(Notify).to receive(:repository_push_email).and_raise(Net::SMTPFatalError) allow(subject).to receive_message_chain(:logger, :info) perform @@ -114,8 +112,6 @@ describe EmailsOnPushWorker do allow_any_instance_of(Mail::TestMailer).to receive(:deliver!).and_wrap_original do |original, mail| original.call(Mail.new(mail.encoded)) end - - reset_delivered_emails! end it "sends the mail to each of the recipients" do |