Sha256: 787224610eb7f7f7ddf83c21750e3f9c98df7dcc7412cb462d2db965e9fbedac

Contents?: true

Size: 1.01 KB

Versions: 49

Compression:

Stored size: 1.01 KB

Contents

require 'test_plugin_helper'

class UploadsSettingsControllerTest < ActionController::TestCase
  tests ForemanInventoryUpload::UploadsSettingsController

  test 'should get upload inventory settings' do
    Setting[:allow_auto_inventory_upload] = true

    assert_equal true, Setting[:allow_auto_inventory_upload]

    get :index, session: set_session_user

    assert_response :success
    actual = JSON.parse(response.body)
    assert_equal true, actual['autoUploadEnabled']
    assert_equal true, Setting[:allow_auto_inventory_upload]
  end

  test 'should update allow_auto_inventory_upload setting' do
    Setting[:allow_auto_inventory_upload] = false

    assert_equal false, Setting[:allow_auto_inventory_upload]

    post :set_advanced_setting, params: { setting: :allow_auto_inventory_upload, value: true }, session: set_session_user

    assert_response :success
    actual = JSON.parse(response.body)
    assert_equal true, actual['autoUploadEnabled']
    assert_equal true, Setting[:allow_auto_inventory_upload]
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

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