Sha256: f31190851659b077b6a0693a5bdf0273fd182a42121fb88946da49a8554ed043

Contents?: true

Size: 739 Bytes

Versions: 96

Compression:

Stored size: 739 Bytes

Contents

require 'test_plugin_helper'

class UploadsControllerTest < ActionController::TestCase
  tests ForemanInventoryUpload::UploadsController

  test 'Returns latest upload status' do
    progress_output = mock('progress_output')
    test_org = FactoryBot.create(:organization)
    ForemanInventoryUpload::Async::ProgressOutput
      .expects(:get)
      .with(ForemanInventoryUpload::Async::UploadReportJob.output_label(test_org.id))
      .returns(progress_output)
    progress_output.expects(:full_output).returns('test output')

    get :last, params: { organization_id: test_org.id }, session: set_session_user

    assert_response :success
    actual = JSON.parse(response.body)
    assert_equal 'test output', actual['output']
  end
end

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
foreman_rh_cloud-5.0.39 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.38 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-4.0.35 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.37 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.36 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.35 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.34 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.33 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-3.0.32 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-4.0.32 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.32 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-4.0.31 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.31 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.30 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-4.0.30 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-3.0.29 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-4.0.29 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.29 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-3.0.28 test/controllers/uploads_controller_test.rb
foreman_rh_cloud-5.0.28 test/controllers/uploads_controller_test.rb