Sha256: af4a170807bb04e02effa34066139d9cd1cfe3c24fc7cfd0ee1f18914531e2a4

Contents?: true

Size: 890 Bytes

Versions: 15

Compression:

Stored size: 890 Bytes

Contents

require 'test_plugin_helper'

class ::ForemanSalt::Api::V2::SaltAutosignControllerTest < ActionController::TestCase
  setup do
    @proxy = FactoryBot.create(:smart_proxy, :with_salt_feature)
    ProxyAPI::Salt.any_instance.stubs(:autosign_list).returns((%w(foo bar baz)))
  end

  test 'should get index' do
    get :index, params: { :smart_proxy_id => @proxy.id }
    assert_response :success
  end

  test 'should create autosign' do
    ProxyAPI::Salt.any_instance.expects(:autosign_create).once.returns(true)
    post :create, params: { :smart_proxy_id => @proxy.id, :record => 'unicorn.example.com' }
    assert_response :success
  end

  test 'should delete autosign' do
    ProxyAPI::Salt.any_instance.expects(:autosign_remove).once.returns(true)
    delete :destroy, params: { :smart_proxy_id => @proxy.id, :record => 'unicorn.example.com' }
    assert_response :success
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
foreman_salt-13.2.4 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-13.2.3 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-13.2.2 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-13.2.1 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-13.2.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-13.1.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-13.0.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-12.0.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-11.0.1 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-11.0.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-10.3.1 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-10.3.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-10.2.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-10.1.0 test/functional/api/v2/salt_autosign_controller_test.rb
foreman_salt-10.0.0 test/functional/api/v2/salt_autosign_controller_test.rb