Sha256: 74e3a6940c2e0557d291f427180c2a5469fa41a1992e548ffc86604d27e5838f

Contents?: true

Size: 389 Bytes

Versions: 5

Compression:

Stored size: 389 Bytes

Contents

require 'spec_helper'

describe GraphQL::EnumType do
  let(:enum) { DairyAnimalEnum }

  it 'coerces names to underlying values' do
    assert_equal("YAK", enum.coerce_input("YAK"))
    assert_equal(1, enum.coerce_input("COW"))
  end

  it 'coerces result values to value name' do
    assert_equal("YAK", enum.coerce_result("YAK"))
    assert_equal("COW", enum.coerce_result(1))
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
graphql-0.10.4 spec/graphql/enum_type_spec.rb
graphql-0.10.3 spec/graphql/enum_type_spec.rb
graphql-0.10.2 spec/graphql/enum_type_spec.rb
graphql-0.10.1 spec/graphql/enum_type_spec.rb
graphql-0.10.0 spec/graphql/enum_type_spec.rb