Sha256: add0dd9d11123a7aaad2156cbb4cfafa2f796e0f4665ed1d3d2c1d1967363632

Contents?: true

Size: 489 Bytes

Versions: 10

Compression:

Stored size: 489 Bytes

Contents

require 'test_plugin_helper'

class HostgroupExtensionsTest < ActiveSupport::TestCase
  test "should remove all linked assets on hostgroup destroy" do
    hostgroup = FactoryBot.create(:hostgroup)
    FactoryBot.create_list(:asset, 3, :assetable_id => hostgroup.id, :assetable_type => 'Hostgroup')
    asset_scope = ::ForemanOpenscap::Asset.where(:assetable_id => hostgroup.id, :assetable_type => 'Hostgroup')
    assert_difference("asset_scope.count", -3) { hostgroup.destroy }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_openscap-10.1.0 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-10.0.3 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-10.0.2 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-10.0.1 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-10.0.0 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-9.0.4 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-9.0.3 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-9.0.2 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-9.0.1 test/unit/concerns/hostgroup_extensions_test.rb
foreman_openscap-9.0.0 test/unit/concerns/hostgroup_extensions_test.rb