Sha256: 6f338f922f5f90a63d0044354f96e4584c9ca8118152f3273ec0975a078eeb61

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 Bytes

Contents

require "spec_helper"

describe GraphQL::Schema::FieldValidator do
  let(:field_defn) {{
    name: "Field",
    description: "Invalid field",
    deprecation_reason: nil,
    arguments: {symbol_arg: nil},
    type: DairyAnimalEnum,
  }}
  let(:field) {
    f = OpenStruct.new(field_defn)
    def f.to_s; f.name; end
    f
  }
  let(:errors) { e = []; GraphQL::Schema::FieldValidator.new.validate(field, e); e }
  it "requires argument names to be strings" do
    expected = ["Field.arguments keys must be Strings, but some aren't: symbol_arg"]
    assert_equal(expected, errors)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graphql-0.13.0 spec/graphql/schema/field_validator_spec.rb