Sha256: 2d0d73a5804844e10a4071592a3b4f05334baadfc10ce223b9bf30e33c897868
Contents?: true
Size: 1.27 KB
Versions: 16
Compression:
Stored size: 1.27 KB
Contents
require 'test_puppet_helper' module Queries class EnvironmentQueryTest < GraphQLQueryTestCase let(:query) do <<-GRAPHQL query ( $id: String! ) { environment(id: $id) { id createdAt updatedAt name locations { totalCount edges { node { id } } } organizations { totalCount edges { node { id } } } } } GRAPHQL end let(:environment) { FactoryBot.create(:environment) } let(:global_id) { Foreman::GlobalId.for(environment) } let(:variables) { { id: global_id } } let(:data) { result['data']['environment'] } test 'fetching environment attributes' do assert_empty result['errors'] assert_equal global_id, data['id'] assert_equal environment.created_at.utc.iso8601, data['createdAt'] assert_equal environment.updated_at.utc.iso8601, data['updatedAt'] assert_equal environment.name, data['name'] assert_collection environment.locations, data['locations'] assert_collection environment.organizations, data['organizations'] end end end
Version data entries
16 entries across 16 versions & 1 rubygems