Sha256: 3a29dcaba17b26637d2c8713734202a1f9d2d7aa1f43e084430bcf1a988c10f8

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

require 'test_plugin_helper'

class AccountsControllerTest < ActionController::TestCase
  tests ForemanInventoryUpload::AccountsController

  include FolderIsolation

  test 'Returns statuses for each process type' do
    test_org = FactoryBot.create(:organization)

    generate_label = ForemanInventoryUpload::Async::GenerateReportJob.output_label(test_org.id)
    generate_output = ForemanInventoryUpload::Async::ProgressOutput.register(generate_label)
    generate_output.status = 'generate_status_test'
    upload_label = ForemanInventoryUpload::Async::UploadReportJob.output_label(test_org.id)
    upload_output = ForemanInventoryUpload::Async::ProgressOutput.register(upload_label)
    upload_output.status = 'upload_status_test'

    get :index, session: set_session_user

    assert_response :success
    actual = JSON.parse(response.body)['accounts'][test_org.id.to_s]
    assert_equal 'generate_status_test', actual['generate_report_status']
    assert_equal 'upload_status_test', actual['upload_report_status']
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
foreman_rh_cloud-0.9.4.1 test/controllers/accounts_controller_test.rb
foreman_rh_cloud-1.0.4.1 test/controllers/accounts_controller_test.rb
foreman_rh_cloud-1.0.4 test/controllers/accounts_controller_test.rb
foreman_rh_cloud-2.0.4 test/controllers/accounts_controller_test.rb
foreman_rh_cloud-0.9.4 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-2.0.4.pre.2 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-2.0.4.pre.1 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-2.0.3 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-1.0.3 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-0.9.2 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-1.0.2 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-0.9.1 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-1.0.1 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-0.9.0 test/controllers/accounts_controller_test.rb
foreman_inventory_upload-1.0.0 test/controllers/accounts_controller_test.rb