Sha256: f043b51bf012ff96a75179ae21a022b68775a501713aafb371ea330b674375f8

Contents?: true

Size: 984 Bytes

Versions: 10

Compression:

Stored size: 984 Bytes

Contents

require 'test_plugin_helper'

module Api
  module V2
    # Tests for the controller to CRUD Ansible Roles
    class AnsibleRolesControllerTest < ActionController::TestCase
      setup do
        @role = FactoryBot.create(:ansible_role)
      end

      test 'should get index' do
        get :index, :session => set_session_user
        response = JSON.parse(@response.body)
        refute_empty response['results']
        assert_response :success
      end

      test 'should destroy' do
        delete :destroy,
               :params => { :id => @role.id },
               :session => set_session_user
        assert_response :ok
        refute AnsibleRole.exists?(@role.id)
      end

      test 'should import' do
        put :import,
            :session => set_session_user
        assert_response :success
      end

      test 'should obsolete' do
        put :obsolete,
            :session => set_session_user
        assert_response :success
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_ansible-2.2.9 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.8 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.7 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.6 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.5 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.4 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.3 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.2 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.1 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-2.2.0 test/functional/api/v2/ansible_roles_controller_test.rb