Sha256: 1c59f0c6ae2e2b74b18e2a5b69523054fee6ee9491c56c88a0484d7c4e71b38f

Contents?: true

Size: 629 Bytes

Versions: 5

Compression:

Stored size: 629 Bytes

Contents

require_relative '../../../../test_plugin_helper'

class ForemanStatistics::Api::V2::StatisticsControllerTest < ActionController::TestCase
  setup do
    @routes = ForemanStatistics::Engine.routes
  end

  test 'should get statistics' do
    get :index
    assert_response :success
    response = ActiveSupport::JSON.decode(@response.body)
    assert_not response.empty?
    expected_keys = %w[arch_count cpu_count env_count klass_count
                       mem_free mem_size mem_totfree mem_totsize
                       model_count os_count swap_free swap_size]

    assert_equal expected_keys, response.keys.sort
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_statistics-1.0.0 test/functional/foreman_statistics/api/v2/statistics_controller_test.rb
foreman_statistics-0.1.3 test/functional/foreman_statistics/api/v2/statistics_controller_test.rb
foreman_statistics-0.1.2 test/functional/foreman_statistics/api/v2/statistics_controller_test.rb
foreman_statistics-0.1.1 test/functional/foreman_statistics/api/v2/statistics_controller_test.rb
foreman_statistics-0.1.0 test/functional/foreman_statistics/api/v2/statistics_controller_test.rb