Sha256: 51da70fe11ac5e0a5d819b8202b9036a78658fbfcfabaacf7def752ba8cf7601
Contents?: true
Size: 1.26 KB
Versions: 34
Compression:
Stored size: 1.26 KB
Contents
require_relative '../test_plugin_helper' require 'integration_test_helper' class HostgroupJsTest < IntegrationTestWithJavascript let(:hostgroup) { FactoryBot.create(:hostgroup, :name => 'HostgroupWithoutRoles') } let(:hostgroup_with_roles) { FactoryBot.create(:hostgroup, :with_ansible_roles, :name => 'HostgroupWithRoles') } setup do FactoryBot.create(:host, :hostgroup_id => hostgroup.id) FactoryBot.create(:host, :hostgroup_id => hostgroup_with_roles.id) end test 'hostgroup without roles should have disabled links' do visit hostgroups_path(search: hostgroup.name) first_row = page.find('table > tbody > tr:nth-child(1)') first_row.find('td:nth-child(4) > div > a').click assert_includes first(:link, 'Run all Ansible roles')[:class], 'disabled' assert_includes first(:link, 'Configure Ansible Job')[:class], 'disabled' end test 'hostgroup with roles should have clickable links' do visit hostgroups_path(search: hostgroup_with_roles.name) first_row = page.find('table > tbody > tr:nth-child(1)') first_row.find('td:nth-child(4) > div > a').click assert_not first(:link, 'Run all Ansible roles')[:class].include?('disabled') assert_not first(:link, 'Configure Ansible Job')[:class].include?('disabled') end end
Version data entries
34 entries across 34 versions & 1 rubygems