Sha256: 9d072bfe850dec8821e4e304b96ae637125d58187fade064f7e23589d07493e5

Contents?: true

Size: 833 Bytes

Versions: 5

Compression:

Stored size: 833 Bytes

Contents

require 'flexmock/test_unit'
require 'shoulda'
require 'test/unit'
require 'unfuddle_my_email'

class EmailTicketTest < Test::Unit::TestCase
  include UnfuddleMyEmail

  context "a EmailTicket instance" do
    setup do
      message = flexmock('message',
                         :subject => 'Hello, world',
                         :from    => ['Matt Haley <matt@example.com>'],
                         :body    => 'Message body.')
      @email_ticket = EmailTicket.new(message)
    end

    should "assign a message" do
      assert @email_ticket.message = "a message"
    end

    should "return xml" do
      assert_equal "<ticket><priority>1</priority><summary>Hello, world</summary><description>From: Matt Haley &lt;matt@example.com&gt;\n\nMessage body.</description></ticket>",
        @email_ticket.to_xml
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unfuddle_my_email-0.2.2 test/email_ticket_test.rb
unfuddle_my_email-0.2.1 test/email_ticket_test.rb
unfuddle_my_email-0.2.0 test/email_ticket_test.rb
unfuddle_my_email-0.1.4 test/email_ticket_test.rb
unfuddle_my_email-0.1.3 test/email_ticket_test.rb