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