# 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