Sha256: 833fce6b19eee21b68a7bb85353bac9560434c7841144603f07665a4074e3f15

Contents?: true

Size: 595 Bytes

Versions: 10

Compression:

Stored size: 595 Bytes

Contents

require 'test_plugin_helper'

module Api
  module V2
    class AnsibleRolesControllerTest < ActionController::TestCase
      setup do
        @role = FactoryGirl.create(:ansible_role)
      end

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_ansible-1.4.5 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.4.3 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.4.2 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.4.1 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.4.0 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.3.1 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.3.0 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.2.1 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.2 test/functional/api/v2/ansible_roles_controller_test.rb
foreman_ansible-1.1 test/functional/api/v2/ansible_roles_controller_test.rb