Sha256: 7a115cd52941a300b9eb42fdd1b4092d0113f8eb1804b6192ee2d2f8b0ef10d6

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

require 'test_plugin_helper'
require 'integration_test_helper'

module ForemanSalt
  class SaltKeysTest < ActionDispatch::IntegrationTest
    setup do
      @proxy = FactoryBot.create :smart_proxy, :with_salt_feature

      ::ProxyAPI::Salt.any_instance.stubs(:autosign_list).returns(
        ['foo.example.com']
      )
    end

    test 'smart proxy page has autosign link' do
      assert_row_button(smart_proxies_path, @proxy.name, 'Salt Autosign', true)
    end

    test 'index page' do
      visit smart_proxy_salt_autosign_index_path(:smart_proxy_id => @proxy.id)
      assert find_link('Keys').visible?, 'Keys is not visible'
      assert has_content?("Autosign entries for #{@proxy.hostname}"), 'Page title does not appear'
      assert has_content?('Displaying'), 'Pagination "Display ..." does not appear'
    end

    test 'has list of autosign' do
      visit smart_proxy_salt_autosign_index_path(:smart_proxy_id => @proxy.id)
      assert has_content?('foo.example.com'), 'Missing autosign entry on index page'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_salt-10.1.0 test/integration/salt_autosign_test.rb
foreman_salt-10.0.0 test/integration/salt_autosign_test.rb