Sha256: bef58b97665f670ba0fc09a030cba40f4a4473946e56e6ef80abe867d6acf47f

Contents?: true

Size: 944 Bytes

Versions: 28

Compression:

Stored size: 944 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    class ContactFormIntegrationTest < Workarea::IntegrationTest
      def test_inquiry_creation
        Workarea.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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-storefront-3.5.27 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.26 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.25 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.23 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.22 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.21 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.20 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.19 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.18 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.17 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.16 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.15 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.14 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.13 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.12 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.11 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.10 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.9 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.8 test/integration/workarea/storefront/contact_form_integration_test.rb
workarea-storefront-3.5.7 test/integration/workarea/storefront/contact_form_integration_test.rb