Sha256: ee9071dba4049db23c75dd524f77c24d59dc03d0b23cd29acb6305d2d708b148

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 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|
        expected_args.each do |expected_arg|
          key = expected_arg.first
          value = expected_arg.second
          expected_value = job_args_arr.first[key]

          assert_equal(expected_value, value)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hephaestus-0.0.2 templates/test/support/rails.rb
hephaestus-0.0.1 templates/test/support/rails.rb