Sha256: ef0ec37fdf525062723d48b01a6ce610104709e8c8ba971d2ae2a30f3fe42934

Contents?: true

Size: 1.02 KB

Versions: 16

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'
require 'workarea/api/documentation_test'

module Workarea
  module Api
    module Storefront
      class ContactsDocumentationTest < DocumentationTest
        resource 'Contacts'

        setup :set_contact_params

        def set_contact_params
          @contact_params = {
            name: 'Name',
            email: 'email@example.com',
            order_id: 'OrderID',
            subject: :orders,
            message: 'Message'
          }
        end

        def test_and_document_create
          description 'Creating a contact'
          route storefront_api.contacts_path
          explanation <<-EOS
            This endpoints creates a customer service inquiry on behalf of the
            customer, and will send an email to the address in
            Workarea.config.email_to
          EOS

          record_request do
            post storefront_api.contacts_path, params: @contact_params, as: :json
            assert_equal(200, response.status)
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
workarea-api-4.5.6 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.5.6 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.5.5 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.5.5 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.5.4 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.5.4 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.5.3 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.5.3 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.5.2 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.5.2 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.5.0 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.5.0 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.4.7 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.4.7 test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-4.4.6 storefront/test/documentation/workarea/api/storefront/contacts_documentation_test.rb
workarea-api-storefront-4.4.6 test/documentation/workarea/api/storefront/contacts_documentation_test.rb