Sha256: bce51900367f0e00bb0bcc0ec0b13b32d693d4754b4b578c9458fcb1ac9b4f2f

Contents?: true

Size: 769 Bytes

Versions: 16

Compression:

Stored size: 769 Bytes

Contents

require 'test_plugin_helper'

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

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

    setup do
      FactoryBot.create_list(:oval_policy, 2, :oval_content => FactoryBot.create(:oval_content))
    end

    test 'should fetch oval policies' do
      assert_empty result['errors']

      expected_count = ForemanOpenscap::OvalPolicy.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

16 entries across 16 versions & 1 rubygems

Version Path
foreman_openscap-8.0.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-7.1.1 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-7.1.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-7.0.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-6.0.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.2.3 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.2.2 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.1.1 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.2.1 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.2.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.1.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-5.0.0 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-4.3.3 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-4.3.2 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-4.3.1 test/graphql/queries/oval_policies_query_test.rb
foreman_openscap-4.3.0 test/graphql/queries/oval_policies_query_test.rb