Sha256: a260eae222e80352dfcb418d3ea4bdc684634c7df4c24490a01a1f12df58a958

Contents?: true

Size: 1.26 KB

Versions: 98

Compression:

Stored size: 1.26 KB

Contents

require 'test_plugin_helper'

module Api
  module V2
    class RemoteExecutionFeaturesControllerTest < ActionController::TestCase
      setup do
        @remote_execution_feature = RemoteExecutionFeature.register(:my_awesome_feature, 'My awesome feature',
          :description => 'You will not believe what it does',
          :provided_inputs => ['awesomeness_level'])
        @template = FactoryBot.create(:job_template, :with_input)
      end

      test 'should get index' do
        get :index
        remote_execution_features = ActiveSupport::JSON.decode(@response.body)
        assert_not remote_execution_features.empty?, 'Should respond with input sets'
        assert_response :success
      end

      test 'should get input set detail' do
        get :show, params: { :id => @remote_execution_feature.to_param }
        assert_response :success
        remote_execution_feature = ActiveSupport::JSON.decode(@response.body)
        assert_not remote_execution_feature.empty?
        assert_equal remote_execution_feature['name'], @remote_execution_feature.name
      end

      test 'should update valid' do
        put :update, params: { :id => @remote_execution_feature.to_param, :job_template_id => @template.id }
        assert_response :ok
      end
    end
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
foreman_remote_execution-14.1.2 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-14.1.1 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-14.0.2 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-14.0.1 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.6 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-14.0.0 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.5 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.4 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.3 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.2 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-12.0.7 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.1 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.2.0 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-10.1.3 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-13.0.0 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-12.0.5 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-12.0.4 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-12.0.1 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-12.0.2 test/functional/api/v2/remote_execution_features_controller_test.rb
foreman_remote_execution-11.1.3 test/functional/api/v2/remote_execution_features_controller_test.rb