Sha256: 8b339767e914b36cb2445cfa543865ecf53bbb25c794d3621a2044b7023f3575

Contents?: true

Size: 807 Bytes

Versions: 5

Compression:

Stored size: 807 Bytes

Contents

require 'test_plugin_helper'

module ForemanDiscovery
  module Concerns
    class HostsControllerTest < ActionController::TestCase
      tests ::HostsController

      context 'hosts controller requests from discovered_hosts url' do
        test 'get "host" params from "discovered_hosts" params' do
          os = FactoryBot.create(:operatingsystem, :with_associations)
          arch_id = os.architectures.first.id
          discovered_host_params = {
            'discovered_host' => { 'architecture_id' => arch_id }
          }

          @request.stubs(:path).returns(architecture_selected_discovered_hosts_path)
          post :architecture_selected, params: discovered_host_params, session: set_session_user
          assert_match(/"#{os.id}"/, response.body)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-13.0.1 test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb
foreman_discovery-12.0.2 test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb
foreman_discovery-12.0.1 test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb
foreman_discovery-12.0.0 test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb
foreman_discovery-11.0.0 test/functional/foreman_discovery/concerns/hosts_controller_extensions_test.rb