Sha256: 74b78c20e8bbbb8db7f7aa375cd099a50ffda3ccb50bf079d9fc33b3730fdc39
Contents?: true
Size: 1.3 KB
Versions: 29
Compression:
Stored size: 1.3 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'] expect(data['name']).must_equal(environment.name) expect(data['id']).must_equal(global_id) expect(data['createdAt']).must_equal(environment.created_at.utc.iso8601) expect(data['updatedAt']).must_equal(environment.updated_at.utc.iso8601) assert_collection environment.locations, data['locations'] assert_collection environment.organizations, data['organizations'] end end end
Version data entries
29 entries across 29 versions & 1 rubygems