Sha256: 453587304a6e10dba91f0f1f34013e3de97961d1f3013f4b2458090e15652ade

Contents?: true

Size: 936 Bytes

Versions: 5

Compression:

Stored size: 936 Bytes

Contents

# frozen_string_literal: true

require 'test_plugin_helper'

module Api
  module V2
    class PreupgradeReportsControllerTest < ActionController::TestCase
      setup do
        @host = FactoryBot.create(:host)
        @report = FactoryBot.create(:preupgrade_report, host: @host)
        @entry = FactoryBot.create(:preupgrade_report_entry, host: @host, preupgrade_report: @report)
      end

      test 'should get index' do
        get :index, session: set_session_user
        assert_response :success
        assert_not_empty ActiveSupport::JSON.decode(@response.body)['results']
      end

      test 'should get detail of report and its entries' do
        get :show, params: { id: @report.id }
        assert_response :success

        response = ActiveSupport::JSON.decode(@response.body)
        assert_equal response['id'], @report.id
        assert_not_empty response['preupgrade_report_entries']
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_leapp-0.0.6 test/functional/api/v2/preupgrade_reports_controller_test.rb
foreman_leapp-0.0.5 test/functional/api/v2/preupgrade_reports_controller_test.rb
foreman_leapp-0.0.4 test/functional/api/v2/preupgrade_reports_controller_test.rb
foreman_leapp-0.0.3 test/functional/api/v2/preupgrade_reports_controller_test.rb
foreman_leapp-0.0.2 test/functional/api/v2/preupgrade_reports_controller_test.rb