Sha256: 98e099bba8c1be68f469f8ecc5082100ec2e6ce06ca23d8dd05a5b133a666b54

Contents?: true

Size: 863 Bytes

Versions: 1

Compression:

Stored size: 863 Bytes

Contents

require_relative 'test_helper'

class SimplePostmarkTest < MiniTest::Unit::TestCase
  def test_responds_to_deliver!
    assert_respond_to Mail::SimplePostmark.new, :deliver!
  end


  def test_makes_request
    WebMock.enable!

    url = 'http://api.postmarkapp.com/email'

    mail = Mail.new do
      from     'barney@himym.tld'
      to       'ted@himym.tld'
      subject  %{I'm your bro!}
      body     %{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!}
      tag      'simple-postmark'
      add_file BROCODE
    end

    mail.delivery_method Mail::SimplePostmark
    stub_request :post, url
    mail.deliver

    assert_requested :post, url, headers: { 'Accept' => 'application/json', 'ContentType' => 'application/json', 'X-Postmark-Server-Token' => '' }

    WebMock.disable!
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_postmark-0.7.0 test/simple_postmark_test.rb