Sha256: e3201fff24b8a61156bce3c76b1e0717138422864190e6cefe8d664c2c298e13

Contents?: true

Size: 752 Bytes

Versions: 141

Compression:

Stored size: 752 Bytes

Contents

require 'test_plugin_helper'

class ReportsControllerTest < ActionController::TestCase
  tests ForemanInventoryUpload::ReportsController

  test 'Returns latest report generation status' do
    progress_output = mock('progress_output')
    test_org = FactoryBot.create(:organization)
    ForemanInventoryUpload::Async::ProgressOutput
      .expects(:get)
      .with(ForemanInventoryUpload::Async::GenerateReportJob.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

141 entries across 141 versions & 2 rubygems

Version Path
foreman_rh_cloud-8.0.48 test/controllers/reports_controller_test.rb
foreman_rh_cloud-8.0.47 test/controllers/reports_controller_test.rb
foreman_rh_cloud-8.0.46 test/controllers/reports_controller_test.rb
foreman_rh_cloud-6.0.45 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.46 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.45 test/controllers/reports_controller_test.rb
foreman_rh_cloud-7.0.46 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.44 test/controllers/reports_controller_test.rb
foreman_rh_cloud-7.0.45 test/controllers/reports_controller_test.rb
foreman_rh_cloud-6.0.44 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.43 test/controllers/reports_controller_test.rb
foreman_rh_cloud-4.0.36 test/controllers/reports_controller_test.rb
foreman_rh_cloud-3.0.33 test/controllers/reports_controller_test.rb
foreman_rh_cloud-6.0.42.2 test/controllers/reports_controller_test.rb
foreman_rh_cloud-6.0.42.1 test/controllers/reports_controller_test.rb
foreman_rh_cloud-6.0.43 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.42 test/controllers/reports_controller_test.rb
foreman_rh_cloud-6.0.42 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.41 test/controllers/reports_controller_test.rb
foreman_rh_cloud-5.0.39 test/controllers/reports_controller_test.rb