Sha256: d263c70653c348b42ed8345d7d26d461ceedf3e0ff306011e326cba33a9c93ac

Contents?: true

Size: 721 Bytes

Versions: 16

Compression:

Stored size: 721 Bytes

Contents

require 'test_plugin_helper'

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

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

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

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

      expected_count = ForemanOpenscap::OvalContent.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_contents_query_test.rb
foreman_openscap-7.1.1 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-7.1.0 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-7.0.0 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-6.0.0 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.2.3 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.2.2 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.1.1 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.2.1 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.2.0 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.1.0 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-5.0.0 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-4.3.3 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-4.3.2 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-4.3.1 test/graphql/queries/oval_contents_query_test.rb
foreman_openscap-4.3.0 test/graphql/queries/oval_contents_query_test.rb