diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index e8235f16d5e..cd8e085050d 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -2,3 +2,5 @@ sidekiq_redis = { url: $redis.url, namespace: 'sidekiq' } Sidekiq.configure_server { |config| config.redis = sidekiq_redis } Sidekiq.configure_client { |config| config.redis = sidekiq_redis } + +Sidekiq.logger.level = Logger::WARN diff --git a/lib/email_sender.rb b/lib/email_sender.rb index 495542b1805..5f6f1a392a4 100644 --- a/lib/email_sender.rb +++ b/lib/email_sender.rb @@ -27,6 +27,8 @@ class EmailSender body PrettyText.cook(plain_body, environment: 'email') end + @message.text_part.content_type = 'text/plain; charset=UTF-8' + @message.deliver to_address = @message.to diff --git a/spec/components/email_sender_spec.rb b/spec/components/email_sender_spec.rb index 2465a7d75e6..f44c11181ab 100644 --- a/spec/components/email_sender_spec.rb +++ b/spec/components/email_sender_spec.rb @@ -62,36 +62,27 @@ describe EmailSender do end - context 'html' do - before do - email_sender.send - end + context 'email parts' do + before { email_sender.send } it 'makes the message multipart' do message.should be_multipart end - it 'has a html part' do - message.parts.detect {|p| p.content_type == "text/html; charset=UTF-8"}.should be_true + it 'sets the correct content type for the plain text part' do + expect(message.text_part.content_type).to eq 'text/plain; charset=UTF-8' end - context 'html part' do - let(:html_part) { message.parts.detect {|p| p.content_type == "text/html; charset=UTF-8"} } - - it 'has a html part' do - html_part.should be_present - end - - it 'has run markdown on the body' do - html_part.body.to_s.should == "
hello
" - end - + it 'sets the correct content type for the html part' do + expect(message.html_part.content_type).to eq 'text/html; charset=UTF-8' end - + it 'converts the html part to html' do + expect(message.html_part.body.to_s).to eq( + "hello
" + ) + end end - - end context 'with a user' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 195a2d5a641..6942dc37fbd 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -51,6 +51,7 @@ Spork.prefork do # let's not run seed_fu every test + SeedFu.quiet = true SeedFu.seed RSpec.configure do |config|