Sha256: 3d09ee90d136e904f3215b06dce3493ebf297202952a55a4f2d52f7a09ddcdf5

Contents?: true

Size: 1.08 KB

Versions: 47

Compression:

Stored size: 1.08 KB

Contents

require 'test_puppet_helper'

module ForemanPuppet
  class PuppetSmartProxiesControllerTest < ActionController::TestCase
    setup do
      @routes = ForemanPuppet::Engine.routes
      stub_smart_proxy_v2_features
    end

    test '#environments' do
      proxy = smart_proxies(:puppetmaster)
      fake_data = { 'env1' => 1, 'special_environment' => 4 }
      ForemanPuppet::ProxyStatus::Puppet.any_instance.expects(:environment_stats).returns(fake_data)
      get :environments, params: { id: proxy.id }, session: set_session_user, xhr: true
      assert_response :success
      assert_template 'foreman_puppet/puppet_smart_proxies/_environments'
      assert_includes @response.body, 'special_environment'
      assert_includes @response.body, '5' # the total is correct
    end

    test '#dashboard' do
      proxy = smart_proxies(:puppetmaster)
      get :dashboard, params: { id: proxy.id }, session: set_session_user, xhr: true
      assert_response :success
      assert_template 'foreman_puppet/puppet_smart_proxies/_dashboard'
      assert_includes @response.body, 'Latest Events'
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
foreman_puppet-1.0.1 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
foreman_puppet-1.0.0 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
foreman_puppet-1.0.0.rc.2 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
foreman_puppet-1.0.0.rc.1 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
foreman_puppet-0.1.0 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
foreman_puppet-0.0.2 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb
foreman_puppet-0.0.1 test/controllers/foreman_puppet/puppet_smart_proxies_controller_test.rb