require File.expand_path('../../spec_helper', __FILE__) describe Mail::Part do describe 'integration into Mail::Part' do subject { Mail::Part.new } it 'responds to +to_postmark+' do subject.new.must_respond_to(:to_postmark) end end describe :to_postmark do describe 'a text/plain part' do let(:content) { "Think of me like Yoda, but instead of being little and green I wear suits and I'm awesome. I'm your bro-I'm Broda!" } subject do Mail::Part.new do body content content_type 'text/plain' end end it 'returns body hash' do part.to_postmark.must_equal('Name' => nil, 'Content' => content, 'ContentType' => 'text/plain') end end describe 'a text/html part' do let(:content) { "
Think of me like Yoda, but instead of being little and green I wear suits and I'm awesome.
I'm your bro-I'm Broda!