Sha256: 5f531500d91d2b02d7392ae3973848f252f60078d9e2815e45f07dc08ba7a525

Contents?: true

Size: 465 Bytes

Versions: 41

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

describe GraphQL::INT_TYPE do
  describe "coerce_input" do
    it "accepts ints and floats" do
      assert_equal 1, GraphQL::INT_TYPE.coerce_isolated_input(1)
      assert_equal 6, GraphQL::INT_TYPE.coerce_isolated_input(6.1)
    end

    it "rejects other types" do
      assert_nil GraphQL::INT_TYPE.coerce_isolated_input("55")
      assert_nil GraphQL::INT_TYPE.coerce_isolated_input(true)
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
graphql-1.8.18 spec/graphql/int_type_spec.rb
graphql-1.8.17 spec/graphql/int_type_spec.rb
graphql-1.8.16 spec/graphql/int_type_spec.rb
graphql-1.8.15 spec/graphql/int_type_spec.rb
graphql-1.9.0.pre4 spec/graphql/int_type_spec.rb
graphql-1.8.14 spec/graphql/int_type_spec.rb
graphql-1.9.0.pre3 spec/graphql/int_type_spec.rb
graphql-1.9.0.pre2 spec/graphql/int_type_spec.rb
graphql-1.8.13 spec/graphql/int_type_spec.rb
graphql-1.8.12 spec/graphql/int_type_spec.rb
graphql-1.9.0.pre1 spec/graphql/int_type_spec.rb
graphql-1.8.11 spec/graphql/int_type_spec.rb
graphql-1.8.10 spec/graphql/int_type_spec.rb
graphql-1.8.9 spec/graphql/int_type_spec.rb
graphql-1.8.8 spec/graphql/int_type_spec.rb
graphql-1.8.7 spec/graphql/int_type_spec.rb
graphql-1.8.6 spec/graphql/int_type_spec.rb
graphql-1.8.5 spec/graphql/int_type_spec.rb
graphql-1.8.4 spec/graphql/int_type_spec.rb
graphql-1.8.3 spec/graphql/int_type_spec.rb