Sha256: 3f356294dc818c512af293e86c164938534031330e5f104a1cf3d2fc51b12fbf

Contents?: true

Size: 413 Bytes

Versions: 45

Compression:

Stored size: 413 Bytes

Contents

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_input(1)
      assert_equal 6, GraphQL::INT_TYPE.coerce_input(6.1)
    end

    it "rejects other types" do
      assert_equal nil, GraphQL::INT_TYPE.coerce_input("55")
      assert_equal nil, GraphQL::INT_TYPE.coerce_input(true)
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
graphql-1.2.6 spec/graphql/int_type_spec.rb
graphql-1.2.5 spec/graphql/int_type_spec.rb
graphql-1.2.4 spec/graphql/int_type_spec.rb
graphql-1.2.3 spec/graphql/int_type_spec.rb
graphql-1.2.2 spec/graphql/int_type_spec.rb
graphql-1.2.1 spec/graphql/int_type_spec.rb
graphql-1.2.0 spec/graphql/int_type_spec.rb
graphql-1.1.0 spec/graphql/int_type_spec.rb
graphql-1.0.0 spec/graphql/int_type_spec.rb
graphql-0.19.4 spec/graphql/int_type_spec.rb
graphql-0.19.3 spec/graphql/int_type_spec.rb
graphql-0.19.2 spec/graphql/int_type_spec.rb
graphql-0.19.1 spec/graphql/int_type_spec.rb
graphql-0.19.0 spec/graphql/int_type_spec.rb
graphql-0.18.15 spec/graphql/int_type_spec.rb
graphql-0.18.14 spec/graphql/int_type_spec.rb
graphql-0.18.13 spec/graphql/int_type_spec.rb
graphql-0.18.12 spec/graphql/int_type_spec.rb
graphql-0.18.11 spec/graphql/int_type_spec.rb
graphql-0.18.10 spec/graphql/int_type_spec.rb