Sha256: 995ee5aa09592098e67ee885fa425774494dba7d87aded6c6639708c76545975

Contents?: true

Size: 479 Bytes

Versions: 28

Compression:

Stored size: 479 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_equal nil, GraphQL::INT_TYPE.coerce_isolated_input("55")
      assert_equal nil, GraphQL::INT_TYPE.coerce_isolated_input(true)
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
graphql-1.8.0.pre1 spec/graphql/int_type_spec.rb
graphql-1.7.6 spec/graphql/int_type_spec.rb
graphql-1.7.5 spec/graphql/int_type_spec.rb
graphql-1.7.4 spec/graphql/int_type_spec.rb
graphql-1.7.3 spec/graphql/int_type_spec.rb
graphql-1.7.2 spec/graphql/int_type_spec.rb
graphql-1.7.1 spec/graphql/int_type_spec.rb
graphql-1.7.0 spec/graphql/int_type_spec.rb
graphql-1.6.8 spec/graphql/int_type_spec.rb
graphql-1.6.7 spec/graphql/int_type_spec.rb
graphql-1.6.6 spec/graphql/int_type_spec.rb
graphql-1.6.5 spec/graphql/int_type_spec.rb
graphql-1.6.4 spec/graphql/int_type_spec.rb
graphql-1.5.15 spec/graphql/int_type_spec.rb
graphql-1.6.3 spec/graphql/int_type_spec.rb
graphql-1.6.2 spec/graphql/int_type_spec.rb
graphql-1.6.1 spec/graphql/int_type_spec.rb
graphql-1.6.0 spec/graphql/int_type_spec.rb
graphql-1.5.14 spec/graphql/int_type_spec.rb
graphql-1.5.13 spec/graphql/int_type_spec.rb