Revision 305ee6f0
Added by Timo Goebel about 5 years ago
test/graphql/queries/compute_attributes_query_test.rb | ||
---|---|---|
require 'test_helper'
|
||
|
||
class Queries::ComputeAttributesQueryTest < GraphQLQueryTestCase
|
||
let(:query) do
|
||
<<-GRAPHQL
|
||
module Queries
|
||
class ComputeAttributesQueryTest < GraphQLQueryTestCase
|
||
let(:query) do
|
||
<<-GRAPHQL
|
||
query {
|
||
computeAttributes {
|
||
totalCount
|
||
... | ... | |
}
|
||
}
|
||
}
|
||
GRAPHQL
|
||
end
|
||
GRAPHQL
|
||
end
|
||
|
||
let(:data) { result['data']['computeAttributes'] }
|
||
let(:data) { result['data']['computeAttributes'] }
|
||
|
||
setup do
|
||
compute_resource = FactoryBot.create(:compute_resource, :vmware, uuid: 'Solutions')
|
||
FactoryBot.create(:compute_profile, :with_compute_attribute, compute_resource: compute_resource)
|
||
end
|
||
setup do
|
||
compute_resource = FactoryBot.create(:compute_resource, :vmware, uuid: 'Solutions')
|
||
FactoryBot.create(:compute_profile, :with_compute_attribute, compute_resource: compute_resource)
|
||
end
|
||
|
||
test 'fetching compute resources attributes' do
|
||
assert_empty result['errors']
|
||
test 'fetching compute resources attributes' do
|
||
assert_empty result['errors']
|
||
|
||
expected_count = ComputeAttribute.count
|
||
expected_count = ComputeAttribute.count
|
||
|
||
assert_not_equal 0, expected_count
|
||
assert_equal expected_count, data['totalCount']
|
||
assert_equal expected_count, data['edges'].count
|
||
assert_not_equal 0, expected_count
|
||
assert_equal expected_count, data['totalCount']
|
||
assert_equal expected_count, data['edges'].count
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #26528 - graphql: refactor AuthorizedModelQuery to resolver