Sha256: 13bef1cd6267c32044b9ff1d6a9bc5de819471113390cff36ee2a4867f086284

Contents?: true

Size: 1018 Bytes

Versions: 3

Compression:

Stored size: 1018 Bytes

Contents

require 'test_plugin_helper'

module ForemanSalt
  class SaltKeysTest < ActionDispatch::IntegrationTest
    setup do
      @proxy = FactoryGirl.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', dropdown = 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.name}"), "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

3 entries across 3 versions & 1 rubygems

Version Path
foreman_salt-0.0.4 test/integration/salt_autosign_test.rb
foreman_salt-0.0.3 test/integration/salt_autosign_test.rb
foreman_salt-0.0.2 test/integration/salt_autosign_test.rb