Sha256: d53ac742f268d6c4061a12a1ee7199dae5af9a4d4f57b021f91d6217682d499b

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 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 link' 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'
  end

  test 'hostgroup with roles should have clickable link' 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')
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_ansible-11.1.1 test/integration/hostgroup_js_test.rb
foreman_ansible-10.4.1 test/integration/hostgroup_js_test.rb
foreman_ansible-11.1.0 test/integration/hostgroup_js_test.rb
foreman_ansible-10.4.0 test/integration/hostgroup_js_test.rb
foreman_ansible-10.3.0 test/integration/hostgroup_js_test.rb
foreman_ansible-11.0.0 test/integration/hostgroup_js_test.rb
foreman_ansible-10.2.0 test/integration/hostgroup_js_test.rb
foreman_ansible-10.1.0 test/integration/hostgroup_js_test.rb
foreman_ansible-10.0.1 test/integration/hostgroup_js_test.rb
foreman_ansible-10.0.0 test/integration/hostgroup_js_test.rb