Sha256: 4f606707d5ef4ed18aa297c1d86513ebdedb7a7b5903d9ab4854c595a393c248
Contents?: true
Size: 1.25 KB
Versions: 6
Compression:
Stored size: 1.25 KB
Contents
require 'test_helper' module Api module V2 class FactValuesControllerExtensionsTest < ActionController::TestCase tests Api::V2::FactValuesController setup do User.current = users(:admin) @facts = { "interfaces" => "lo,eth0", "ipaddress" => "192.168.100.42", "ipaddress_eth0" => "192.168.100.42", "macaddress_eth0" => "AA:BB:CC:DD:EE:FF", "discovery_bootif" => "AA:BB:CC:DD:EE:FF", "memorysize_mb" => "42000.42", "discovery_version" => "3.0.0", } FactoryGirl.create(:setting, :name => 'discovery_hostname', :value => 'discovery_bootif', :category => 'Setting::Discovered') end test 'list discovered host facts' do disable_orchestration facts = @facts.merge({ "somefact" => "abc" }) host = Host::Discovered.import_host(facts) get :index, { :discovered_host_id => host.id } assert_response :success show_response = ActiveSupport::JSON.decode(@response.body) assert_equal "abc", show_response['results'].values.first['somefact'] end end end end
Version data entries
6 entries across 6 versions & 1 rubygems