source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/schema/member/has_unresolved_type_error_spec.rb | Ruby | mit | 5,430 | master | 1,864 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Schema::Member::HasUnresolvedTypeError do
it "adds error classes to interfaces and unions" do
assert_equal Jazz::NamedEntity::UnresolvedTypeError.superclass, GraphQL::UnresolvedTypeError
assert_equal Jazz::PerformingAct::UnresolvedTypeErro... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/schema/visibility/profile_spec.rb | Ruby | mit | 5,430 | master | 3,915 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Schema::Visibility::Profile do
class ProfileSchema < GraphQL::Schema
class Thing < GraphQL::Schema::Object
field :name, String, method: :to_s
end
class Query < GraphQL::Schema::Object
field :thing, Thing, fallback_value: :... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/type_kinds/type_kind_spec.rb | Ruby | mit | 5,430 | master | 492 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::TypeKinds::TypeKind do
describe ".leaf?" do
it "is true for enums and scalars, but false for others" do
assert GraphQL::Schema::Scalar.kind.leaf?
assert GraphQL::Schema::Enum.kind.leaf?
refute GraphQL::Schema::Object.kind.lea... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/validator_spec.rb | Ruby | mit | 5,430 | master | 5,928 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::Validator do
let(:validator) { GraphQL::StaticValidation::Validator.new(schema: Dummy::Schema) }
let(:query) { GraphQL::Query.new(Dummy::Schema, query_string) }
let(:validate) { true }
let(:errors) { validator.validate(quer... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/argument_literals_are_compatible_spec.rb | Ruby | mit | 5,430 | master | 12,569 | # frozen_string_literal: true
require "spec_helper"
require "uri"
describe GraphQL::StaticValidation::ArgumentLiteralsAreCompatible do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese {
stringCheese: cheese(id: "aasdlkfj") { ...cheeseFields }
cheese(id: 1) { source @skip(if: "... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fields_will_merge_spec.rb | Ruby | mit | 5,430 | master | 45,403 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FieldsWillMerge do
include StaticValidationHelpers
let(:schema) {
GraphQL::Schema.from_definition(%|
type Query {
dog: Dog
cat: Cat
pet: Pet
toy: Toy
animal: Animal
}
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/unique_directives_per_location_spec.rb | Ruby | mit | 5,430 | master | 5,549 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::UniqueDirectivesPerLocation do
include StaticValidationHelpers
let(:schema) { GraphQL::Schema.from_definition("
type Query {
type: Type
}
type Type {
field: String
}
directive @A on FIELD
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragments_are_finite_spec.rb | Ruby | mit | 5,430 | master | 3,574 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentsAreFinite do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese {
cheese(id: 1) {
... idField
... sourceField
similarCheese(source: SHEEP) {
... flavorFi... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/directives_are_defined_spec.rb | Ruby | mit | 5,430 | master | 1,841 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::DirectivesAreDefined do
include StaticValidationHelpers
let(:query_string) {"
query getCheese {
okCheese: cheese(id: 1) {
id @skip(if: true),
source @nonsense(if: false)
... on Cheese {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/variable_default_values_are_correctly_typed_spec.rb | Ruby | mit | 5,430 | master | 5,498 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese(
$id: Int = 1,
$str: String!,
$badInt: Int = "abc",
$input: Dairy... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/arguments_are_defined_spec.rb | Ruby | mit | 5,430 | master | 2,713 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::ArgumentsAreDefined do
include StaticValidationHelpers
let(:query_string) {"
query getCheese {
okCheese: cheese(id: 1) { source }
cheese(silly: false, id: 2) { source }
searchDairy(product: [{wacky: 1}]) ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/required_arguments_are_present_spec.rb | Ruby | mit | 5,430 | master | 2,823 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::RequiredArgumentsArePresent do
include StaticValidationHelpers
let(:query_string) {"
query getCheese {
okCheese: cheese(id: 1) { ...cheeseFields }
cheese { source }
}
fragment cheeseFields on Cheese {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/subscription_root_exists_and_single_selection_spec.rb | Ruby | mit | 5,430 | master | 1,653 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::SubscriptionRootExistsAndSingleSubscriptionSelection do
include StaticValidationHelpers
let(:query_string) {%|
subscription {
test
}
|}
let(:schema) {
Class.new(GraphQL::Schema) do
query_root = Cla... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb | Ruby | mit | 5,430 | master | 1,602 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::NoDefinitionsArePresent do
include StaticValidationHelpers
describe "when schema definitions are present in the query" do
let(:query_string) {
<<-GRAPHQL
{
cheese(id: 1) { flavor }
}
type Th... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fields_have_appropriate_selections_spec.rb | Ruby | mit | 5,430 | master | 8,234 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FieldsHaveAppropriateSelections do
include StaticValidationHelpers
let(:query_string) {"
query getCheese {
okCheese: cheese(id: 1) { fatContent, similarCheese(source: YAK) { source } }
missingFieldsObject: chees... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragment_spreads_are_possible_spec.rb | Ruby | mit | 5,430 | master | 1,815 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentSpreadsArePossible do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese {
cheese(id: 1) {
... milkFields
... cheeseFields
... on Milk { fatContent }
... on... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/directives_are_in_valid_locations_spec.rb | Ruby | mit | 5,430 | master | 1,664 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::DirectivesAreInValidLocations do
include StaticValidationHelpers
describe "invalid directive locations" do
let(:query_string) {"
query getCheese @skip(if: true) {
okCheese: cheese(id: 1) {
id @skip(... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/operation_names_are_valid_spec.rb | Ruby | mit | 5,430 | master | 3,154 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::OperationNamesAreValid do
include StaticValidationHelpers
describe "when there are multiple operations" do
let(:query_string) { <<-GRAPHQL
query getCheese {
cheese(id: 1) { flavor }
}
{
cheese(id: ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/variables_are_used_and_defined_spec.rb | Ruby | mit | 5,430 | master | 4,115 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::VariablesAreUsedAndDefined do
include StaticValidationHelpers
let(:query_string) {'
query getCheese(
$usedVar: Int!,
$usedInnerVar: [DairyAnimal!]!,
$usedInlineFragmentVar: Int!,
$usedFragmentVar: I... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/variable_usages_are_allowed_spec.rb | Ruby | mit | 5,430 | master | 12,298 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::VariableUsagesAreAllowed do
include StaticValidationHelpers
let(:query_string) {'
query getCheese(
$goodInt: Int = 1,
$okInt: Int!,
$badInt: Int,
$badStr: String!,
$goodAnimals: [Dai... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fields_are_defined_on_type_spec.rb | Ruby | mit | 5,430 | master | 5,243 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FieldsAreDefinedOnType do
include StaticValidationHelpers
let(:query_string) { "
query getCheese {
notDefinedField { name }
cheese(id: 1) { nonsenseField, flavor ...cheeseFields }
fromSource(source: COW) {... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/mutation_root_exists_spec.rb | Ruby | mit | 5,430 | master | 961 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::MutationRootExists do
include StaticValidationHelpers
let(:query_string) {%|
mutation addBagel {
introduceShip(input: {shipName: "Bagel"}) {
clientMutationId
shipEdge {
node { name, id }
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragments_are_used_spec.rb | Ruby | mit | 5,430 | master | 3,125 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentsAreUsed do
include StaticValidationHelpers
let(:query_string) {"
query getCheese {
name
...cheeseFields
...undefinedFields
}
fragment cheeseFields on Cheese { fatContent }
fragment unu... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragments_are_named_spec.rb | Ruby | mit | 5,430 | master | 608 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentTypesExist do
include StaticValidationHelpers
let(:query_string) {"
fragment on Cheese {
id
flavor
}
"}
it "finds non-existent types on fragments" do
assert_equal(1, errors.length)
frag... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragments_are_on_composite_types_spec.rb | Ruby | mit | 5,430 | master | 1,659 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentsAreOnCompositeTypes do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese {
cheese(id: 1) {
... on Cheese {
source
... on Boolean {
something
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragment_names_are_unique_spec.rb | Ruby | mit | 5,430 | master | 2,060 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentNamesAreUnique do
include StaticValidationHelpers
let(:query_string) {"
query {
cheese(id: 1) {
... frag1
}
}
fragment frag1 on Cheese { id }
fragment frag1 on Cheese { id }
"}
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/required_input_object_attributes_are_present_spec.rb | Ruby | mit | 5,430 | master | 5,489 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese {
stringCheese: cheese(id: "aasdlkfj") { ...cheeseFields }
cheese(id: 1) { source @skip(if: "wha... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/argument_names_are_unique_spec.rb | Ruby | mit | 5,430 | master | 2,155 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::ArgumentNamesAreUnique do
include StaticValidationHelpers
describe "field arguments" do
let(:query_string) { <<-GRAPHQL
query GetStuff {
c1: cheese(id: 1, id: 2) { flavor }
c2: cheese(id: 2) { flavor }
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/one_of_input_objects_are_valid_spec.rb | Ruby | mit | 5,430 | master | 3,580 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::OneOfInputObjectsAreValid do
include StaticValidationHelpers
let(:schema) {
GraphQL::Schema.from_definition(%|
type Query {
oneOfArgField(oneOfArg: OneOfArgInput): String
}
input OneOfArgInput @o... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/variables_are_input_types_spec.rb | Ruby | mit | 5,430 | master | 3,101 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::VariablesAreInputTypes do
include StaticValidationHelpers
let(:query_string) {'
query getCheese(
$id: Int = 1,
$str: [String!],
$interface: AnimalProduct!,
$object: Milk = 1,
$... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/fragment_types_exist_spec.rb | Ruby | mit | 5,430 | master | 1,718 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::FragmentTypesExist do
include StaticValidationHelpers
let(:query_string) {"
query getCheese {
cheese(id: 1) {
... on Cheese { source }
... on Nothing { whatever }
... somethingFields
.... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/input_object_names_are_unique_spec.rb | Ruby | mit | 5,430 | master | 2,160 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::InputObjectNamesAreUnique do
include StaticValidationHelpers
let(:query_string) {%|
query getCheese {
validInputObjectName: searchDairy(product: [{source: YAK}]) { __typename }
duplicateInputObjectNames: search... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/static_validation/rules/variable_names_are_unique_spec.rb | Ruby | mit | 5,430 | master | 1,351 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::StaticValidation::VariableNamesAreUnique do
include StaticValidationHelpers
let(:query_string) { <<-GRAPHQL
query GetStuff($var1: Int!, $var2: Int!, $var1: Int!, $var2: Int!, $var3: Int!) {
c1: cheese(id: $var1) { flavor }
c2: cheese(... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/cop/field_type_in_block_spec.rb | Ruby | mit | 5,430 | master | 1,671 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Cop::FieldTypeInBlock" do
include RubocopTestHelpers
it "finds and autocorrects field corrections with inline types" do
result = run_rubocop_on("spec/fixtures/cop/field_type.rb")
assert_equal 3, rubocop_errors(result)
assert_inclu... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/cop/default_required_true_spec.rb | Ruby | mit | 5,430 | master | 997 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Cop::DefaultRequiredTrue" do
include RubocopTestHelpers
it "finds and autocorrects `required: true` argument configurations" do
result = run_rubocop_on("spec/fixtures/cop/required_true.rb")
assert_equal 4, rubocop_errors(result)
a... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/cop/default_null_true_spec.rb | Ruby | mit | 5,430 | master | 749 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Cop::DefaultNullTrue" do
include RubocopTestHelpers
it "finds and autocorrects `null: true` field configurations" do
result = run_rubocop_on("spec/fixtures/cop/null_true.rb")
assert_equal 3, rubocop_errors(result)
assert_includes ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/cop/root_types_in_block_spec.rb | Ruby | mit | 5,430 | master | 689 | # frozen_string_literal: true
require 'spec_helper'
describe "GraphQL::Cop::RootTypesInBlock" do
include RubocopTestHelpers
it "finds and autocorrects field corrections with inline types" do
result = run_rubocop_on("spec/fixtures/cop/root_types.rb")
assert_equal 3, rubocop_errors(result)
assert_inclu... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader/active_record_source_spec.rb | Ruby | mit | 5,430 | master | 4,951 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Dataloader::ActiveRecordSource do
if testing_rails?
include VulfpeckSchemaHelpers
it "works with field config shorthands" do
skip("Not implemented") unless TESTING_EXEC_NEXT
query_str = "{ rootBand { name } }"
assert_equa... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader/nonblocking_dataloader_spec.rb | Ruby | mit | 5,430 | master | 8,037 | # frozen_string_literal: true
require "spec_helper"
if Fiber.respond_to?(:scheduler) # Ruby 3+
describe "GraphQL::Dataloader::NonblockingDataloader" do
class NonblockingSchema < GraphQL::Schema
class SleepSource < GraphQL::Dataloader::Source
def fetch(keys)
max_sleep = keys.max
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader/active_record_association_source_spec.rb | Ruby | mit | 5,430 | master | 8,964 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Dataloader::ActiveRecordAssociationSource do
if testing_rails?
include VulfpeckSchemaHelpers
it "works with different scopes on the same object at runtime" do
query_str = <<~GRAPHQL
{
band(name: "Vulfpeck") {
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader/null_dataloader_spec.rb | Ruby | mit | 5,430 | master | 392 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL NullDataloader" do
it "can run_isolated with previously-captured blocks that register lazies" do
dl = GraphQL::Dataloader::NullDataloader.new
result = 0
dl.run_isolated {
lazy = GraphQL::Execution::Lazy.new { result = 100 }
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader/async_dataloader_spec.rb | Ruby | mit | 5,430 | master | 10,893 | # frozen_string_literal: true
require "spec_helper"
if RUBY_VERSION >= "3.2.0"
require "async"
describe GraphQL::Dataloader::AsyncDataloader do
class AsyncSchema < GraphQL::Schema
class SleepSource < GraphQL::Dataloader::Source
def initialize(tag = nil)
@tag = tag
end
de... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/dataloader/source_spec.rb | Ruby | mit | 5,430 | master | 3,781 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Dataloader::Source do
class FailsToLoadSource < GraphQL::Dataloader::Source
def fetch(keys)
dataloader.with(FailsToLoadSource).load_all(keys)
end
end
if testing_rails?
describe "with field configuration shorthands" do
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/lexer_spec.rb | Ruby | mit | 5,430 | master | 439 | # frozen_string_literal: true
require "spec_helper"
require_relative "./lexer_examples"
describe GraphQL::Language::Lexer do
subject { GraphQL::Language::Lexer }
include LexerExamples
def assert_bad_unicode(string, expected_err_message = "Parse error on bad Unicode escape sequence")
err = assert_raises(Graph... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/equality_spec.rb | Ruby | mit | 5,430 | master | 2,187 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::Nodes::AbstractNode do
describe ".eql?" do
let(:document1) { GraphQL.parse(query_string1) }
let(:document2) { GraphQL.parse(query_string2) }
describe "large identical document" do
let(:query_string1) {%|
query ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/document_from_schema_definition_spec.rb | Ruby | mit | 5,430 | master | 24,643 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::DocumentFromSchemaDefinition do
let(:subject) { GraphQL::Language::DocumentFromSchemaDefinition }
describe "#document" do
let(:schema_idl) { <<-GRAPHQL
type QueryType {
foo: Foo
u: Union
}
type F... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/lexer_examples.rb | Ruby | mit | 5,430 | master | 8,681 | # frozen_string_literal: true
module TokenMethods
refine Array do
def name
self[0]
end
def value
self[3]
end
def to_s
self[3]
end
def line
self[1]
end
def col
self[2]
end
def inspect
"(#{name} #{value.inspect} [#{line}:#{col}])"
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/parser_spec.rb | Ruby | mit | 5,430 | master | 22,176 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::Parser do
subject { GraphQL }
it "returns an error on bad UTF-8" do
err = assert_raises GraphQL::ParseError do
subject.parse("{ foo(query: \"\xBF\") }")
end
expected_message = if USING_C_PARSER
'Parse error on ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/printer_spec.rb | Ruby | mit | 5,430 | master | 11,628 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::Printer do
let(:document) { GraphQL.parse(query_string) }
let(:query_string) {%|
query getStuff($someVar: Int = 1, $anotherVar: [String!] @special(very: true), $skipNested: Boolean! = false) @skip(if: false) {
myField: someFi... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/clexer_spec.rb | Ruby | mit | 5,430 | master | 2,479 | # frozen_string_literal: true
require "spec_helper"
require_relative "./lexer_examples"
if defined?(GraphQL::CParser::Lexer)
describe GraphQL::CParser::Lexer do
subject { GraphQL::CParser::Lexer }
def assert_bad_unicode(string, _message = nil)
assert_equal :BAD_UNICODE_ESCAPE, subject.tokenize(string)... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/nodes_spec.rb | Ruby | mit | 5,430 | master | 9,234 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::Nodes::AbstractNode do
describe ".visit_method" do
# `.visit_method` is really helpful for generating methods in
# custom visitor classes -- make sure this API keeps working.
it "names a method on the visitor class" do
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/definition_slice_spec.rb | Ruby | mit | 5,430 | master | 5,370 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::DefinitionSlice do
let(:document) { GraphQL.parse(query_string) }
describe "anonymous query with no dependencies" do
let(:query_string) {%|
{
version
}
|}
it "is already the smallest slice" do
as... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/generation_spec.rb | Ruby | mit | 5,430 | master | 856 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::Generation do
describe "#to_query_tring" do
let(:document) {
GraphQL.parse('type Query { a: String! }')
}
let(:custom_printer_class) {
Class.new(GraphQL::Language::Printer) {
def print_field_definition(pr... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/block_string_spec.rb | Ruby | mit | 5,430 | master | 2,237 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::BlockString do
describe "trimming whitespace" do
def trim_whitespace(str)
GraphQL::Language::BlockString.trim_whitespace(str)
end
it "matches the examples in graphql-js" do
# these are taken from:
# https:/... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/sanitized_printer_spec.rb | Ruby | mit | 5,430 | master | 10,784 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::SanitizedPrinter do
module SanitizeTest
class Color < GraphQL::Schema::Enum
value "RED"
value "BLUE"
end
class Url < GraphQL::Schema::Scalar
end
class SimpleInput < GraphQL::Schema::InputObject
arg... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/graphql/language/visitor_spec.rb | Ruby | mit | 5,430 | master | 10,929 | # frozen_string_literal: true
require "spec_helper"
describe GraphQL::Language::Visitor do
let(:document) { GraphQL.parse("
query cheese {
cheese(id: 1) {
flavor,
source,
producers(first: 3) {
name
}
... cheeseFields
}
}
fragment cheeseFields... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/mongoid_setup.rb | Ruby | mit | 5,430 | master | 380 | # frozen_string_literal: true
if testing_mongoid?
# TODO make this work with existing fixtures
Mongoid.load_configuration({
clients: {
default: {
database: 'graphql_ruby_test',
hosts: ['localhost:27017']
}
},
sessions: {
default: {
database: 'graphql_ruby_test'... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/global_id.rb | Ruby | mit | 5,430 | master | 558 | # frozen_string_literal: true
if defined?(GlobalID)
GlobalID.app = "graphql-ruby-test"
class GlobalIDUser
include GlobalID::Identification
attr_reader :id
def initialize(id, located_many: false)
@id = id
@located_many = located_many
end
def located_many?
@located_many
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/dummy_scheduler.rb | Ruby | mit | 5,430 | master | 5,013 | # frozen_string_literal: true
# From the Ruby source (https://github.com/ruby/ruby/blob/master/test/fiber/scheduler.rb)
#
# This is an example and simplified scheduler for test purposes.
# It is not efficient for a large number of file descriptors as it uses IO.select().
# Production Fiber schedulers should use epoll/k... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/jazz.rb | Ruby | mit | 5,430 | master | 26,804 | # frozen_string_literal: true
# Here's the "application"
module Jazz
module Models
Instrument = Struct.new(:name, :family)
Ensemble = Struct.new(:name)
Musician = Struct.new(:name, :favorite_key)
Key = Struct.new(:root, :sharp, :flat) do
def self.from_notation(key_str)
key, sharp_or_fla... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/rubocop_test_helpers.rb | Ruby | mit | 5,430 | master | 1,790 | # frozen_string_literal: true
require "yaml"
module RubocopTestHelpers
def run_rubocop_on(fixture_path, autocorrect: false)
assert_cop_runs_on(fixture_path)
result = `bundle exec rubocop --debug #{autocorrect ? "--auto-correct" : ""} --config spec/fixtures/cop/.rubocop.yml #{fixture_path} 2>&1`
refute_in... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/connection_assertions.rb | Ruby | mit | 5,430 | master | 17,287 | # frozen_string_literal: true
# A shared module for testing ArrayConnection, RelationConnection,
# DatasetConnection and MongoRelationConnection.
#
# The test must implement `schema` to serve the queries below with the expected results.
module ConnectionAssertions
MAX_PAGE_SIZE = 6
DEFAULT_PAGE_SIZE = 4
NAMES = ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/appoptics.rb | Ruby | mit | 5,430 | master | 937 | # frozen_string_literal: true
# A stub for the AppOpticsAPM agent, so we can make assertions about how it is used
if defined?(AppOpticsAPM) && !AppOpticsAPM.graphql_test
raise "Expected AppOpticsAPM to be undefined, so that we can define a stub for it."
end
module AppOpticsAPM
def self.loaded; true; end
module ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/scout_apm.rb | Ruby | mit | 5,430 | master | 853 | # frozen_string_literal: true
# A stub for the Scout agent, so we can make assertions about how it is used
if defined?(ScoutApm)
raise "Expected ScoutApm to be undefined, so that we could define a stub for it."
end
class ScoutApm
TRANSACTION_NAMES = []
EVENTS = []
def self.clear_all
TRANSACTION_NAMES.clea... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/sentry.rb | Ruby | mit | 5,430 | master | 1,275 | # frozen_string_literal: true
# A stub for the Sentry agent, so we can make assertions about how it is used
if defined?(Sentry)
raise "Expected Sentry to be undefined, so that we could define a stub for it."
end
module Sentry
SPAN_OPS = []
SPAN_DATA = []
SPAN_DESCRIPTIONS = []
TRANSACTION_NAMES = []
clas... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/minimum_input_object.rb | Ruby | mit | 5,430 | master | 328 | # frozen_string_literal: true
# This is the minimum required interface for an input object
class MinimumInputObject
include Enumerable
def initialize(values)
@values = values
end
def each(&block)
@values.each(&block)
end
def [](key)
@values[key]
end
def key?(key)
@values.key?(key)
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/datadog.rb | Ruby | mit | 5,430 | master | 972 | # frozen_string_literal: true
# A stub for the Datadog agent, so we can make assertions about how it is used
if defined?(Datadog)
raise "Expected Datadog to be undefined, so that we could define a stub for it."
end
module Datadog
SPAN_RESOURCE_NAMES = []
SPAN_TAGS = []
TRACE_KEYS = []
def self.tracer
Du... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/lazy_helpers.rb | Ruby | mit | 5,430 | master | 4,817 | # frozen_string_literal: true
module LazyHelpers
MAGIC_NUMBER_WITH_LAZY_AUTHORIZED_HOOK = 44
MAGIC_NUMBER_THAT_RETURNS_NIL = 0
MAGIC_NUMBER_THAT_RAISES_ERROR = 13
class Wrapper
def initialize(item = nil, &block)
if block
@block = block
else
@item = item
end
end
def... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/new_relic.rb | Ruby | mit | 5,430 | master | 1,046 | # frozen_string_literal: true
# A stub for the NewRelic agent, so we can make assertions about how it is used
if defined?(NewRelic)
raise "Expected NewRelic to be undefined, so that we could define a stub for it."
end
module NewRelic
TRANSACTION_NAMES = []
EXECUTION_SCOPES = []
# Reset state between tests
de... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/perfetto_snapshot.rb | Ruby | mit | 5,430 | master | 4,634 | # frozen_string_literal: true
module PerfettoSnapshot
def check_snapshot(data, snapshot_name)
prev_file = caller(1, 1).first.sub(/\/[a-z_]*\.rb:.*/, "")
snapshot_dir = prev_file + "/snapshots"
snapshot_path = "#{snapshot_dir}/#{snapshot_name}"
iid_table = { "debugAnnotationNames" => {}, "eventNames" ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/active_record_setup.rb | Ruby | mit | 5,430 | master | 8,928 | # frozen_string_literal: true
if testing_rails?
# Remove the old sqlite database
sqlite_path = File.expand_path(File.join(__FILE__, "../../../_test_.db"))
puts "Removing #{sqlite_path}"
`rm -f #{sqlite_path}`
if ActiveRecord.respond_to?(:async_query_executor=) # Rails 7.1+
ActiveRecord.async_query_execut... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/static_validation_helpers.rb | Ruby | mit | 5,430 | master | 925 | # frozen_string_literal: true
# This module assumes you have `let(:query_string)` in your spec.
# It provides `errors` which are the validation errors for that string,
# as validated against `Dummy::Schema`.
# You can override `schema` to provide another schema
# @example testing static validation
# include StaticVal... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/dummy/schema.rb | Ruby | mit | 5,430 | master | 17,262 | # frozen_string_literal: true
require "graphql"
require_relative "./data"
module Dummy
class NoSuchDairyError < StandardError; end
class BaseField < GraphQL::Schema::Field
end
class AdminField < GraphQL::Schema::Field
def visible?(context)
context[:admin] == true
end
end
module BaseInterfac... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/dummy/data.rb | Ruby | mit | 5,430 | master | 1,163 | # frozen_string_literal: true
require 'ostruct'
module Dummy
module Data
Cheese = Struct.new(:id, :flavor, :origin, :fat_content, :source) do
def ==(other)
# This is buggy on purpose -- it shouldn't be called during execution.
other.id == id
end
# Alias for when this is treated ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/support/star_wars/schema.rb | Ruby | mit | 5,430 | master | 12,400 | # frozen_string_literal: true
module StarWars
# Adapted from graphql-relay-js
# https://github.com/graphql/graphql-relay-js/blob/master/src/__tests__/starWarsSchema.js
class Ship < GraphQL::Schema::Object
implements GraphQL::Types::Relay::Node
global_id_field :id
field :name, String
# Test cyclic... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/Rakefile | Ruby | mit | 5,430 | master | 257 | # frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test_autoloads.rb | Ruby | mit | 5,430 | master | 1,367 | # frozen_string_literal: true
# Extracted and adapted from this talk from Ben Sheldon:
# `An ok compromise. Faster development by designing for the Rails Autoloader`
# Youtube video link: https://youtu.be/9-PWz9nbrT8?si=Lw7qsF2_VmBperId&t=1487
require_relative "./config/application"
autoloaded_constants = []
Rails.... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/puma.rb | Ruby | mit | 5,430 | master | 2,336 | # frozen_string_literal: true
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minim... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/application.rb | Ruby | mit | 5,430 | master | 655 | # frozen_string_literal: true
require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "action_cable/engine"
require "sprockets/railtie"
require "rails/test_unit/railtie"... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/initializers/inflections.rb | Ruby | mit | 5,430 | master | 677 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflect... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/initializers/wrap_parameters.rb | Ruby | mit | 5,430 | master | 369 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_cont... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/initializers/filter_parameter_logging.rb | Ruby | mit | 5,430 | master | 224 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password] |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/initializers/application_controller_renderer.rb | Ruby | mit | 5,430 | master | 246 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/initializers/cookies_serializer.rb | Ruby | mit | 5,430 | master | 274 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/environments/test.rb | Ruby | mit | 5,430 | master | 1,535 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "sc... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/environments/development.rb | Ruby | mit | 5,430 | master | 1,388 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don'... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/config/environments/production.rb | Ruby | mit | 5,430 | master | 3,110 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, al... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/app/graphql/dummy_schema.rb | Ruby | mit | 5,430 | master | 1,986 | # frozen_string_literal: true
begin
require "graphql-pro"
rescue LoadError => err
puts "Skipping GraphQL::Pro: #{err.message}"
end
class DummySchema < GraphQL::Schema
class Query < GraphQL::Schema::Object
field :str, String, fallback_value: "hello"
field :sleep, Float do
argument :seconds, Float
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/app/graphql/mock_pusher.rb | Ruby | mit | 5,430 | master | 1,697 | # frozen_string_literal: true
class MockPusher
class Channel
attr_reader :id, :occupants
def initialize(id)
@id = id
@occupants = 0
@inboxes = [[]]
end
def trigger(event_name, payload)
if event_name != "update"
raise "Invariant: GraphQL is only expected to call update... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/app/channels/graphql_channel.rb | Ruby | mit | 5,430 | master | 3,363 | # frozen_string_literal: true
class GraphqlChannel < ActionCable::Channel::Base
class QueryType < GraphQL::Schema::Object
field :value, Integer, null: false
def value
3
end
end
class PayloadType < GraphQL::Schema::Object
field :value, Integer, null: false
end
class CounterIncremented <... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/system/action_cable_subscription_test.rb | Ruby | mit | 5,430 | master | 6,999 | # frozen_string_literal: true
require "application_system_test_case"
class ActionCableSubscriptionsTest < ApplicationSystemTestCase
setup do
ActionCable.server.config.logger = Logger.new(STDOUT)
end
# This test covers a lot of ground!
test "it handles subscriptions" do
# Load the page and let the subsc... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/application_controller_test.rb | Ruby | mit | 5,430 | master | 253 | # frozen_string_literal: true
require "test_helper"
class DashboardApplicationControllerTest < ActionDispatch::IntegrationTest
def test_it_calls_on_load_hook
assert_equal true, GraphQL::Dashboard::ApplicationController.hook_was_called?
end
end |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/landings_controller_test.rb | Ruby | mit | 5,430 | master | 1,054 | # frozen_string_literal: true
require "test_helper"
class DashboardLandingsControllerTest < ActionDispatch::IntegrationTest
def test_it_doesnt_load_autoloads_files
result = `BUNDLE_GEMFILE=#{ENV["BUNDLE_GEMFILE"]} ruby ./test_autoloads.rb`
assert_includes result, "No autoloaded constants were found during th... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/statics_controller_test.rb | Ruby | mit | 5,430 | master | 1,094 | # frozen_string_literal: true
require "test_helper"
class DashboardStaticsControllerTest < ActionDispatch::IntegrationTest
def test_it_serves_assets
get graphql_dashboard.static_path("dashboard.css")
assert_includes response.body, "#header-icon {"
assert_equal response.headers["Cache-Control"], "max-age=... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/subscriptions/topics_controller_test.rb | Ruby | mit | 5,430 | master | 2,394 | # frozen_string_literal: true
require "test_helper"
require "ostruct" # TODO use a real class in RedisBackend
if defined?(GraphQL::Pro)
class DashboardSubscriptionsTopicsControllerTest < ActionDispatch::IntegrationTest
def test_it_checks_installed
get graphql_dashboard.subscriptions_topics_path, params: { ... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/detailed_traces/traces_controller_test.rb | Ruby | mit | 5,430 | master | 3,069 | # frozen_string_literal: true
require "test_helper"
class DashboardTracesControllerTest < ActionDispatch::IntegrationTest
def teardown
DummySchema.detailed_trace.delete_all_traces
end
def test_it_renders_not_installed
get graphql_dashboard.detailed_traces_traces_path, params: { schema: "NotInstalledSche... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/operation_store/operations_controller_test.rb | Ruby | mit | 5,430 | master | 3,675 | # frozen_string_literal: true
require "test_helper"
if defined?(GraphQL::Pro)
class DashboardOperationStoreOperationsControllerTest < ActionDispatch::IntegrationTest
def teardown
DummySchema.operation_store.delete_client("client-1")
DummySchema.operation_store.delete_client("client-2")
super
... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/operation_store/clients_controller_test.rb | Ruby | mit | 5,430 | master | 2,608 | # frozen_string_literal: true
require "test_helper"
if defined?(GraphQL::Pro)
class DashboardOperationStoreClientsControllerTest < ActionDispatch::IntegrationTest
def test_it_manages_clients
assert_equal 0, DummySchema.operation_store.all_clients(page: 1, per_page: 1).total_count
get graphql_dashboar... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/operation_store/index_entries_controller_test.rb | Ruby | mit | 5,430 | master | 1,455 | # frozen_string_literal: true
require "test_helper"
if defined?(GraphQL::Pro)
class DashboardOperationStoreIndexEntriesControllerTest < ActionDispatch::IntegrationTest
def test_it_shows_entries
DummySchema.operation_store.upsert_client("client-1", "abcdef")
DummySchema.operation_store.add(body: "quer... |
github | rmosolgo/graphql-ruby | https://github.com/rmosolgo/graphql-ruby | spec/dummy/test/controllers/dashboard/limiters/limiters_controller_test.rb | Ruby | mit | 5,430 | master | 1,515 | # frozen_string_literal: true
require "test_helper"
if defined?(GraphQL::Pro)
class DashboardLimitersLimitersControllerTest < ActionDispatch::IntegrationTest
def test_it_checks_installed
get graphql_dashboard.limiters_limiter_path("runtime", { schema: "GraphQL::Schema" })
assert_includes response.bod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.