Sha256: 5edc4503047fdcb7c166a3b00d68b785e86e753f90f13008d0a45a93f1ddb036

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

# typed: false
# frozen_string_literal: true

ENV["RAILS_ENV"] ||= "test"
require_relative "../../config/environment"

module ActiveSupport
  class TestCase
    extend T::Sig

    # Run tests in parallel with specified workers
    parallelize(workers: :number_of_processors)

    def setup
      @organization_id ||= "org_#{Faker::Alphanumeric.alphanumeric(number: 26).upcase}"
      @plug_installation_id ||= "pli_#{Faker::Alphanumeric.alphanumeric(number: 26).upcase}"
      @inbox_id ||= "ibx_#{Faker::Alphanumeric.alphanumeric(number: 26).upcase}"
      @plug_id ||= "plg_#{Faker::Alphanumeric.alphanumeric(number: 26).upcase}"
      @message_id ||= "msg_#{Faker::Alphanumeric.alphanumeric(number: 26).upcase}"
      @conversation_id ||= "cnv_#{Faker::Alphanumeric.alphanumeric(number: 26).upcase}"
    end

    def file_fixture_path(dir, name)
      Rails.root.join("test", "fixtures", "files", dir, name)
    end

    def assert_expected_args(expected_args)
      lambda do |job_args_arr|
        job_args_arr.first.each do |actual_args|
          actual_key = actual_args.first
          actual_value = actual_args.second

          expected_value = expected_args[actual_key]

          assert_equal(expected_value, actual_value)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hephaestus-0.1.3 templates/test/support/rails.rb
hephaestus-0.1.2 templates/test/support/rails.rb
hephaestus-0.1.1 templates/test/support/rails.rb