Sha256: 6ea467ab2ad9651dac4d5a3b436d72094506ee7e8fe48966a7b40f90b52ac287

Contents?: true

Size: 954 Bytes

Versions: 5

Compression:

Stored size: 954 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"

class UnusedDestroyAsync < ActiveRecord::Base
  self.destroy_association_async_job = nil
end

class UnusedBelongsTo < ActiveRecord::Base
  self.destroy_association_async_job = nil
end

class ActiveJobNotPresentTest < ActiveRecord::TestCase
  test "has_one dependent destroy_async requires activejob" do
    assert_raises ActiveRecord::ActiveJobRequiredError do
      UnusedDestroyAsync.has_one :unused_belongs_to, dependent: :destroy_async
    end
  end

  test "has_many dependent destroy_async requires activejob" do
    assert_raises ActiveRecord::ActiveJobRequiredError do
      UnusedDestroyAsync.has_many :essay_destroy_asyncs, dependent: :destroy_async
    end
  end

  test "belong_to dependent destroy_async requires activejob" do
    assert_raises ActiveRecord::ActiveJobRequiredError do
      UnusedBelongsTo.belongs_to :unused_destroy_asyncs, dependent: :destroy_async
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ibm_db-5.5.0 test/activejob/destroy_async_job_not_present_test.rb
ibm_db-5.4.1 test/activejob/destroy_async_job_not_present_test.rb
ibm_db-5.4.0 test/activejob/destroy_async_job_not_present_test.rb
ibm_db-5.3.2 test/activejob/destroy_async_job_not_present_test.rb
ibm_db-5.3.1 test/activejob/destroy_async_job_not_present_test.rb