Sha256: 5be1d1e912b07c0fc2104c21c26963809b6fe02740cd5d3e23880d605e603636

Contents?: true

Size: 763 Bytes

Versions: 12

Compression:

Stored size: 763 Bytes

Contents

require 'config'

class GraphQL_Type_Scalar_IntScalarTest < GraphQL::TestCase
  DESCRIBED_CLASS = Rails::GraphQL::Type::Scalar::IntScalar

  def test_valid_input_ask
    assert(DESCRIBED_CLASS.valid_input?(12345))
    assert(DESCRIBED_CLASS.valid_input?(2147483647))

    refute(DESCRIBED_CLASS.valid_input?(12.0))
    refute(DESCRIBED_CLASS.valid_input?(2147483649))
    refute(DESCRIBED_CLASS.valid_input?('2147483649'))
  end

  def test_valid_output_ask
    assert(DESCRIBED_CLASS.valid_output?(12345))

    refute(DESCRIBED_CLASS.valid_output?(2147483649))
    refute(DESCRIBED_CLASS.valid_output?('2147483649'))
  end

  def test_as_json
    assert_equal(123, DESCRIBED_CLASS.as_json(123))
    assert_nil(nil, DESCRIBED_CLASS.as_json(2147483649))
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails-graphql-1.0.2 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-1.0.1 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-1.0.0 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-1.0.0.rc2 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-1.0.0.rc1 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-1.0.0.beta test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-0.2.1 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-0.2.0 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-0.1.3 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-0.1.2 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-0.1.1 test/graphql/type/scalar/int_scalar_test.rb
rails-graphql-0.1.0 test/graphql/type/scalar/int_scalar_test.rb