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-0.14.1 spec/graphql/int_type_spec.rb
graphql-0.14.0 spec/graphql/int_type_spec.rb
graphql-0.13.0 spec/graphql/int_type_spec.rb
graphql-0.12.1 spec/graphql/int_type_spec.rb
graphql-0.12.0 spec/graphql/int_type_spec.rb