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