Sha256: e4aaf0260adcff2ca311a5e3737f4d9b7d573075a41c7c1bdd9f6cd3f0256632

Contents?: true

Size: 831 Bytes

Versions: 25

Compression:

Stored size: 831 Bytes

Contents

require 'test_plugin_helper'

class PolicyDashboardHelperTest < ActionView::TestCase
  include ArfReportDashboardHelper
  include PolicyDashboardHelper

  test 'should return data for policy breakdown chart' do
    report = {
      :compliant_hosts => 5,
      :incompliant_hosts => 6,
      :inconclusive_hosts => 7,
      :report_missing => 8
    }
    res = JSON.parse(policy_breakdown_chart_data(report))
    assert_equal 4, res.size
    assert_include res, ['Compliant hosts', 5, PolicyDashboardHelper::COLORS[:compliant_hosts]]
    assert_include res, ['Incompliant hosts', 6, PolicyDashboardHelper::COLORS[:incompliant_hosts]]
    assert_include res, ['Inconclusive', 7, PolicyDashboardHelper::COLORS[:inconclusive_hosts]]
    assert_include res, ['Not audited', 8, PolicyDashboardHelper::COLORS[:report_missing]]
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
foreman_openscap-4.3.3 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.3.2 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.3.1 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.3.0 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.1.3 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.6 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.2.0 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.5 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.1.2 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.1.1 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.1.0 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.4 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.3 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.2 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.1 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-3.0.1 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-4.0.0 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-3.0.0 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-2.0.2 test/helpers/policy_dashboard_helper_test.rb
foreman_openscap-1.0.10 test/helpers/policy_dashboard_helper_test.rb