Sha256: 5daa0427c691bca9a907cc9559cd00e2eb164a82a3478c3298024aece1ee9fb9

Contents?: true

Size: 1 KB

Versions: 34

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

module Workarea
  module Storefront
    class ContactFormIntegrationTest < Workarea::IntegrationTest
      def test_inquiry_creation
        Workarea.with_config do |config|
          config.email_to = 'test@workarea.com'

          post storefront.contact_path,
            params: {
              name: 'Ben Crouse',
              email: 'bcrouse@workarea.com',
              subject: 'orders',
              order_id: 'ORDER123',
              message: 'test message'
            }

          result = Inquiry.first
          assert_equal('Ben Crouse', result.name)
          assert_equal('bcrouse@workarea.com', result.email)
          assert(result.subject.present?)
          assert_equal('ORDER123', result.order_id)
          assert_equal('test message', result.message)

          last_email = ActionMailer::Base.deliveries.last
          assert_includes(last_email.subject, 'Orders')
          assert_includes(last_email.to, Workarea.config.email_to)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-storefront-3.4.45 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.44 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.43 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.42 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.41 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.40 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.39 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.38 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.37 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.36 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.35 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.34 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.33 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.32 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.31 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.30 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.29 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.28 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.27 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.4.26 test/integration/workarea/storefront/contact_form_integration_test.rb