Sha256: ce9d163eeb291cfcffcdba1fda88cbbb399890cee5530f8d4caec34f39d7ae25
Contents?: true
Size: 1.24 KB
Versions: 45
Compression:
Stored size: 1.24 KB
Contents
require 'test_puppet_helper' module Queries class OrganizationQueryTest < GraphQLQueryTestCase let(:query) do <<-GRAPHQL query ( $id: String! ) { organization(id: $id) { id environments { totalCount edges { node { id } } } puppetclasses { totalCount edges { node { id } } } } } GRAPHQL end let(:environment) { FactoryBot.create(:environment) } let(:organization_object) { FactoryBot.create(:organization, environments: [environment]) } let(:global_id) { Foreman::GlobalId.for(organization_object) } let(:variables) { { id: global_id } } let(:data) { result['data']['organization'] } setup do FactoryBot.create(:puppetclass, environments: [environment]) end test 'fetching organization attributes' do assert_empty result['errors'] assert_equal global_id, data['id'] assert_collection organization_object.environments, data['environments'] assert_collection organization_object.puppetclasses, data['puppetclasses'] end end end
Version data entries
45 entries across 45 versions & 1 rubygems