Sha256: 3d31029c9016039bfb7834ae7b2f8187bad6c0717c00ab35e1c6e66092100afd

Contents?: true

Size: 781 Bytes

Versions: 13

Compression:

Stored size: 781 Bytes

Contents

require "test_helper"

class MailerTest < ActiveSupport::TestCase

  test "sends out order notification" do
    order = create(:order_with_line_items)

    mail = Mailer.order_notification_to_buyer(order.number)

    assert_equal "Order confirmation for order ##{order.number}", mail.subject
    assert_equal ['john@nimbleshop.com'], mail.to
    assert_match /Here is receipt for your purchase/, mail.encoded
  end

  test "sends out shipment notification" do
    order = create(:order_paid_using_authorizedotnet)

    mail = Mailer.shipment_notification_to_buyer(order.number)

    assert_equal "Items for order ##{order.number} have been shipped", mail.subject
    assert_equal ['john@nimbleshop.com'], mail.to
    assert_match /Items have been shipped/, mail.encoded
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.5 test/mailers/mailer_test.rb
nimbleshop_core-0.0.4.beta1 test/mailers/mailer_test.rb
nimbleshop_core-0.0.4 test/mailers/mailer_test.rb
nimbleshop_core-0.0.3 test/mailers/mailer_test.rb
nimbleshop_core-0.0.2 test/mailers/mailer_test.rb
nimbleshop_core-0.0.2.beta1 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1.rc6 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1.rc5 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1.rc4 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1.rc3 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1.rc2 test/mailers/mailer_test.rb
nimbleshop_core-0.0.1.rc1 test/mailers/mailer_test.rb