Revision 305ee6f0
Added by Timo Goebel about 5 years ago
test/graphql/queries/environments_query_test.rb | ||
---|---|---|
require 'test_helper'
|
||
|
||
class Queries::EnvironmentsQueryTest < GraphQLQueryTestCase
|
||
let(:query) do
|
||
<<-GRAPHQL
|
||
module Queries
|
||
class EnvironmentsQueryTest < GraphQLQueryTestCase
|
||
let(:query) do
|
||
<<-GRAPHQL
|
||
query {
|
||
environments {
|
||
totalCount
|
||
... | ... | |
}
|
||
}
|
||
}
|
||
GRAPHQL
|
||
end
|
||
GRAPHQL
|
||
end
|
||
|
||
let(:data) { result['data']['environments'] }
|
||
let(:data) { result['data']['environments'] }
|
||
|
||
setup do
|
||
FactoryBot.create_list(:environment, 2)
|
||
end
|
||
setup do
|
||
FactoryBot.create_list(:environment, 2)
|
||
end
|
||
|
||
test 'fetching environments attributes' do
|
||
assert_empty result['errors']
|
||
test 'fetching environments attributes' do
|
||
assert_empty result['errors']
|
||
|
||
expected_count = Environment.count
|
||
expected_count = Environment.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