foreman_discovery 15.0.2 → 15.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,7 @@ class DiscoveredHostsTest < IntegrationTestWithJavascript
9
9
  assert discovered_notification_blueprint
10
10
  discovered_host.save!
11
11
  visit discovered_hosts_path
12
+ page.evaluate_script("document.getElementById('fixedPropertiesSelector-#{discovered_host.id}').classList.remove('fade')")
12
13
  end
13
14
 
14
15
  teardown do
@@ -64,15 +65,14 @@ class DiscoveredHostsTest < IntegrationTestWithJavascript
64
65
 
65
66
  test 'and forwards to editing it' do
66
67
  create_host
67
- assert_equal edit_discovered_host_path(id: discovered_host),
68
- current_path
68
+ assert_current_path edit_discovered_host_path(id: discovered_host), ignore_query: true
69
69
  end
70
70
 
71
71
  context 'with a Hostgroup selected' do
72
72
  let(:discovery_hostgroup) { Hostgroup.first }
73
73
 
74
74
  test 'it passes it on' do
75
- select_from('host_hostgroup_id', discovery_hostgroup.id)
75
+ select2(discovery_hostgroup.name, from: 'host_hostgroup_id')
76
76
  create_host
77
77
  assert_param discovery_hostgroup.id.to_s,
78
78
  'host.hostgroup_id'
@@ -83,7 +83,7 @@ class DiscoveredHostsTest < IntegrationTestWithJavascript
83
83
  let(:discovery_location) { Location.first }
84
84
 
85
85
  test 'it passes it on' do
86
- select_from('host_location_id', discovery_location.id)
86
+ select2(discovery_location.name, from: 'host_location_id')
87
87
  create_host
88
88
  assert_param discovery_location.id.to_s,
89
89
  'host.location_id'
@@ -94,7 +94,7 @@ class DiscoveredHostsTest < IntegrationTestWithJavascript
94
94
  let(:discovery_organization) { Organization.first }
95
95
 
96
96
  test 'it passes it on' do
97
- select_from('host_organization_id', discovery_organization.id)
97
+ select2(discovery_organization.name, from: 'host_organization_id')
98
98
  create_host
99
99
  assert_param discovery_organization.id.to_s,
100
100
  'host.organization_id'
@@ -147,12 +147,6 @@ class DiscoveredHostsTest < IntegrationTestWithJavascript
147
147
  page.find("#host_ids_#{id}").click
148
148
  end
149
149
 
150
- def select_from(element_id, id)
151
- page.find_by_id(element_id, visible: false)
152
- .find("option[value='#{id}']", visible: false)
153
- .select_option
154
- end
155
-
156
150
  def create_host
157
151
  page.find("#fixedPropertiesSelector-#{discovered_host.id}")
158
152
  .find_button('Create Host').click
@@ -41,15 +41,17 @@ class DiscoveryAttributeSetTest < ActiveSupport::TestCase
41
41
  end
42
42
 
43
43
  test "can search discovered hosts by disks_size" do
44
- excluded = Setting[:excluded_facts]
45
- Setting[:excluded_facts] = ["test"]
46
- host = discover_host_from_facts(@facts)
47
- disks_size = (host.facts_hash['blockdevice_sda_size'].to_f / 1024 / 1024).ceil
48
- results = Host::Discovered.unscoped.search_for("disks_size = #{disks_size}")
49
- assert_equal 1, results.count
50
- results = Host::Discovered.unscoped.search_for("disks_size > #{disks_size}")
51
- assert_equal 0, results.count
52
- ensure
53
- Setting[:excluded_facts] = excluded
44
+ begin
45
+ excluded = Setting[:excluded_facts]
46
+ Setting[:excluded_facts] = ["test"]
47
+ host = discover_host_from_facts(@facts)
48
+ disks_size = (host.facts_hash['blockdevice_sda_size'].to_f / 1024 / 1024).ceil
49
+ results = Host::Discovered.unscoped.search_for("disks_size = #{disks_size}")
50
+ assert_equal 1, results.count
51
+ results = Host::Discovered.unscoped.search_for("disks_size > #{disks_size}")
52
+ assert_equal 0, results.count
53
+ ensure
54
+ Setting[:excluded_facts] = excluded
55
+ end
54
56
  end
55
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_discovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.0.2
4
+ version: 15.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditi Puntambekar
@@ -45,6 +45,7 @@ authors:
45
45
  - odovzhenko
46
46
  - Ohad Levy
47
47
  - Ondrej Prazak
48
+ - Ondřej Ezr
48
49
  - Ori Rabin
49
50
  - orrabin
50
51
  - Partha Aji
@@ -68,7 +69,7 @@ authors:
68
69
  autorequire:
69
70
  bindir: bin
70
71
  cert_chain: []
71
- date: 2019-08-01 00:00:00.000000000 Z
72
+ date: 2019-08-09 00:00:00.000000000 Z
72
73
  dependencies: []
73
74
  description: MaaS Discovery Plugin engine for Foreman
74
75
  email: gsutclif@redhat.com