=begin #MailSlurp API #MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository ## Basic Concepts ### Inboxes Inboxes have real email addresses that can send and receive emails. You can create inboxes with specific email addresses (using custom domains). You can also use randomly assigned MailSlurp addresses as unique, disposable test addresses. See the InboxController or [inbox and email address guide](https://www.mailslurp.com/guides/) for more information. ### Receive Emails You can receive emails in a number of ways. You can fetch emails and attachments directly from an inbox. Or you can use `waitFor` endpoints to hold a connection open until an email is received that matches given criteria (such as subject or body content). You can also use webhooks to have emails from multiple inboxes forwarded to your server via HTTP POST. InboxController methods with `waitFor` in the name have a long timeout period and instruct MailSlurp to wait until an expected email is received. You can set conditions on email counts, subject or body matches, and more. Most receive methods only return an email ID and not the full email (to keep response sizes low). To fetch the full body or attachments for an email use the email's ID with EmailController endpoints. See the InboxController or [receiving emails guide](https://www.mailslurp.com/guides/) for more information. ### Send Emails You can send templated HTML emails in several ways. You must first create an inbox to send an email. An inbox can have a specific address or a randomly assigned one. You can send emails from an inbox using `to`, `cc`, and `bcc` recipient lists or with contacts and contact groups. Emails can contain plain-text or HTML bodies. You can also use email templates that support [moustache](https://mustache.github.io/) template variables. You can send attachments by first posting files to the AttachmentController and then using the returned IDs in the `attachments` field of the send options. See the InboxController or [sending emails guide](https://www.mailslurp.com/guides/) for more information. ### Templates MailSlurp emails support templates. You can create templates in the dashboard or API that contain [moustache](https://mustache.github.io/) style variables: for instance `Hello {{name}}`. Then when sending emails you can pass a map of variables names and values to be used. Additionally, when sending emails with contact groups you can use properties of the contact in your templates like `{{firstName}}` and `{{lastName}}`. > You can do a lot more with MailSlurp so see the included documentation for more information. The version of the OpenAPI document: 6.5.2 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.2.3 =end require 'spec_helper' require 'json' # Unit tests for MailSlurpClient::CommonActionsControllerApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'CommonActionsControllerApi' do before do # run before each test @api_instance = MailSlurpClient::CommonActionsControllerApi.new end after do # run after each test end describe 'test an instance of CommonActionsControllerApi' do it 'should create an instance of CommonActionsControllerApi' do expect(@api_instance).to be_instance_of(MailSlurpClient::CommonActionsControllerApi) end end # unit tests for create_new_email_address # Create new random inbox # Returns an Inbox with an `id` and an `emailAddress` # @param [Hash] opts the optional parameters # @return [Inbox] describe 'create_new_email_address test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for empty_inbox # Delete all emails in an inbox # Deletes all emails # @param inbox_id inboxId # @param [Hash] opts the optional parameters # @return [nil] describe 'empty_inbox test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for send_email_simple # Send an email from a random email address # To specify an email address first create an inbox and use that with the other send email methods # @param send_email_options sendEmailOptions # @param [Hash] opts the optional parameters # @return [nil] describe 'send_email_simple test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for wait_for_email_count # Wait for and return count number of emails # Will only wait if count is greater that the found emails in given inbox.If you need to wait for an email for a non-empty inbox see the other receive methods. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1 # @option opts [String] :inbox_id Id of the inbox we are fetching emails from # @option opts [Integer] :timeout Max milliseconds to wait # @option opts [Boolean] :unread_only Optional filter for unread only # @return [Array] describe 'wait_for_email_count test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for wait_for_latest_email # Fetch inbox's latest email or if empty wait for email to arrive # Will return either the last received email or wait for an email to arrive and return that. If you need to wait for an email for a non-empty inbox see the other receive methods. # @param [Hash] opts the optional parameters # @option opts [String] :inbox_id Id of the inbox we are fetching emails from # @option opts [Integer] :timeout Max milliseconds to wait # @option opts [Boolean] :unread_only Optional filter for unread only # @return [Email] describe 'wait_for_latest_email test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for wait_for_matching_email # Wait or return list of emails that match simple matching patterns # Results must also meet provided count. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. # @param match_options matchOptions # @param [Hash] opts the optional parameters # @option opts [Integer] :count Number of emails to wait for. Must be greater that 1 # @option opts [String] :inbox_id Id of the inbox we are fetching emails from # @option opts [Integer] :timeout Max milliseconds to wait # @option opts [Boolean] :unread_only Optional filter for unread only # @return [Array] describe 'wait_for_matching_email test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for wait_for_nth_email # Wait for or fetch the email with a given index in the inbox specified # @param [Hash] opts the optional parameters # @option opts [String] :inbox_id Id of the inbox you are fetching emails from # @option opts [Integer] :index Zero based index of the email to wait for # @option opts [Integer] :timeout Max milliseconds to wait # @option opts [Boolean] :unread_only Optional filter for unread only # @return [Email] describe 'wait_for_nth_email test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end