Sha256: f42fcecccf390e67cf5ecb613fa31cf1f54cae35c9c4eb08b541fe5066634e49

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

require 'test_plugin_helper'

class StatusesControllerTest < ActionController::TestCase
  tests ForemanInventoryUpload::StatusesController

  include FolderIsolation

  test 'Returns statuses for each process type' do
    configuration = RedhatAccess::TelemetryConfiguration.new(enable_telemetry: true, portal_user: 'test')
    configuration.save!

    generate_label = ForemanInventoryUpload::Async::GenerateReportJob.output_label('test')
    generate_output = ForemanInventoryUpload::Async::ProgressOutput.register(generate_label)
    generate_output.status = 'generate_status_test'
    upload_label = ForemanInventoryUpload::Async::UploadReportJob.output_label('test')
    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)['statuses']['test']
    assert_equal 'generate_status_test', actual['generate_report_status']
    assert_equal 'upload_status_test', actual['upload_report_status']
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_inventory_upload-1.0.0.beta7 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-1.0.0.beta6 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-1.0.0.beta5 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-1.0.0.beta4 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-1.0.0.beta3 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-1.0.0.beta2 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-1.0.0.beta1 test/controllers/statuses_controller_test.rb
foreman_inventory_upload-0.0.1.dev1 test/controllers/statuses_controller_test.rb