Sha256: 8e3b7071d6551221f91c471de6c5ef548e33520166160933263a06592059684c

Contents?: true

Size: 703 Bytes

Versions: 58

Compression:

Stored size: 703 Bytes

Contents

require 'test_plugin_helper'

module Queries
  class AnsibleRolesQueryTest < GraphQLQueryTestCase
    let(:query) do
      <<-GRAPHQL
      query {
        ansibleRoles {
          totalCount
          nodes {
            id
            name
          }
        }
      }
      GRAPHQL
    end

    let(:data) { result['data']['ansibleRoles'] }

    setup do
      FactoryBot.create_list(:ansible_role, 2)
    end

    test 'should fetch Ansible roles' do
      assert_empty result['errors']

      expected_count = AnsibleRole.count

      assert_not_equal 0, expected_count
      assert_equal expected_count, data['totalCount']
      assert_equal expected_count, data['nodes'].count
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
foreman_ansible-12.0.5 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-10.4.3 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-12.0.4 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-10.4.2 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-12.0.3 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-12.0.2 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-12.0.1 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-12.0.0 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-11.2.1 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-7.1.7 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-11.2.0 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-11.1.2 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-7.1.6 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-11.1.1 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-10.4.1 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-7.1.5 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-11.1.0 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-10.4.0 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-10.3.0 test/graphql/queries/ansible_roles_query_test.rb
foreman_ansible-11.0.0 test/graphql/queries/ansible_roles_query_test.rb