Sha256: d8578ba5fb889e46a86c77be149f6619698b1abbdb7a18a022c9e69159ab6172

Contents?: true

Size: 643 Bytes

Versions: 102

Compression:

Stored size: 643 Bytes

Contents

require 'test_plugin_helper'

class InsightsFacetTest < ActiveSupport::TestCase
  setup do
    @host = FactoryBot.create(:host, :with_insights_hits)
    InsightsFacet.reset_counters(@host.insights.id, :hits_count)
  end

  test 'host with hits can be deleted' do
    assert_equal 1, @host.insights.hits.count

    host_id = @host.id
    @host.destroy
    actual_host = Host.find_by_id(host_id)
    assert_nil actual_host
  end

  test 'search host by recommendations_count' do
    FactoryBot.create(:host) # create another host with no recommendations

    assert_equal 1, Host.search_for('insights_recommendations_count = 1').count
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
foreman_rh_cloud-9.0.59 test/unit/insights_facet_test.rb
foreman_rh_cloud-11.0.2 test/unit/insights_facet_test.rb
foreman_rh_cloud-11.0.1 test/unit/insights_facet_test.rb
foreman_rh_cloud-11.0.0 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.58 test/unit/insights_facet_test.rb
foreman_rh_cloud-10.0.2 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.57 test/unit/insights_facet_test.rb
foreman_rh_cloud-10.0.1 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.56 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.55 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.54 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.53 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.52 test/unit/insights_facet_test.rb
foreman_rh_cloud-8.0.52 test/unit/insights_facet_test.rb
foreman_rh_cloud-9.0.51 test/unit/insights_facet_test.rb
foreman_rh_cloud-8.0.51 test/unit/insights_facet_test.rb
foreman_rh_cloud-7.0.48 test/unit/insights_facet_test.rb
foreman_rh_cloud-7.0.47 test/unit/insights_facet_test.rb
foreman_rh_cloud-8.0.50 test/unit/insights_facet_test.rb
foreman_rh_cloud-8.0.49 test/unit/insights_facet_test.rb