Sha256: 5dd1eb15b5363c6a22b3ffd6cd890095f02933095ad88a8afbf616a23184ffc3

Contents?: true

Size: 1.38 KB

Versions: 58

Compression:

Stored size: 1.38 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, "Expected `#{actual_key}` to be `#{expected_value.nil? ? "nil" : expected_value}`, but was `#{actual_value.nil? ? "nil" : actual_value}`")
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
hephaestus-0.8.11 templates/test/support/rails.rb
hephaestus-0.8.10 templates/test/support/rails.rb
hephaestus-0.8.9.2 templates/test/support/rails.rb
hephaestus-0.8.9.1 templates/test/support/rails.rb
hephaestus-0.8.9 templates/test/support/rails.rb
hephaestus-0.8.8 templates/test/support/rails.rb
hephaestus-0.8.7.5 templates/test/support/rails.rb
hephaestus-0.8.7.4 templates/test/support/rails.rb
hephaestus-0.8.7.3 templates/test/support/rails.rb
hephaestus-0.8.7.2 templates/test/support/rails.rb
hephaestus-0.8.7.1 templates/test/support/rails.rb
hephaestus-0.8.7 templates/test/support/rails.rb
hephaestus-0.8.6 templates/test/support/rails.rb
hephaestus-0.8.5 templates/test/support/rails.rb
hephaestus-0.8.4.1 templates/test/support/rails.rb
hephaestus-0.8.4 templates/test/support/rails.rb
hephaestus-0.8.3.4 templates/test/support/rails.rb
hephaestus-0.8.3.3 templates/test/support/rails.rb
hephaestus-0.8.3.2 templates/test/support/rails.rb
hephaestus-0.8.3.1 templates/test/support/rails.rb