Merge pull request #918 from chrishunt/chrishunt/quiet-tests-please

Clean up test output
This commit is contained in:
Robin Ward 2013-05-29 12:17:04 -07:00
commit 8182a9d10c
4 changed files with 16 additions and 20 deletions

View file

@ -2,3 +2,5 @@ sidekiq_redis = { url: $redis.url, namespace: 'sidekiq' }
Sidekiq.configure_server { |config| config.redis = sidekiq_redis } Sidekiq.configure_server { |config| config.redis = sidekiq_redis }
Sidekiq.configure_client { |config| config.redis = sidekiq_redis } Sidekiq.configure_client { |config| config.redis = sidekiq_redis }
Sidekiq.logger.level = Logger::WARN

View file

@ -27,6 +27,8 @@ class EmailSender
body PrettyText.cook(plain_body, environment: 'email') body PrettyText.cook(plain_body, environment: 'email')
end end
@message.text_part.content_type = 'text/plain; charset=UTF-8'
@message.deliver @message.deliver
to_address = @message.to to_address = @message.to

View file

@ -62,36 +62,27 @@ describe EmailSender do
end end
context 'html' do context 'email parts' do
before do before { email_sender.send }
email_sender.send
end
it 'makes the message multipart' do it 'makes the message multipart' do
message.should be_multipart message.should be_multipart
end end
it 'has a html part' do it 'sets the correct content type for the plain text part' do
message.parts.detect {|p| p.content_type == "text/html; charset=UTF-8"}.should be_true expect(message.text_part.content_type).to eq 'text/plain; charset=UTF-8'
end end
context 'html part' do it 'sets the correct content type for the html part' do
let(:html_part) { message.parts.detect {|p| p.content_type == "text/html; charset=UTF-8"} } expect(message.html_part.content_type).to eq '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 == "<p><strong>hello</strong></p>"
end
end end
it 'converts the html part to html' do
expect(message.html_part.body.to_s).to eq(
"<p><strong>hello</strong></p>"
)
end
end end
end end
context 'with a user' do context 'with a user' do

View file

@ -51,6 +51,7 @@ Spork.prefork do
# let's not run seed_fu every test # let's not run seed_fu every test
SeedFu.quiet = true
SeedFu.seed SeedFu.seed
RSpec.configure do |config| RSpec.configure do |config|