Sha256: 353dbde5487c9ee0fe11cf69385edc450c82468f23e8f551cb2d292ba5470fb1

Contents?: true

Size: 778 Bytes

Versions: 28

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"
require "generators/graphql/enum_generator"

class GraphQLGeneratorsEnumGeneratorTest < BaseGeneratorTest
  tests Graphql::Generators::EnumGenerator

  test "it generate enums with values" do
    expected_content = <<-RUBY
module Types
  class FamilyType < Types::BaseEnum
    value "NIGHTSHADE"
    value "BRASSICA", value: Family::COLE
    value "UMBELLIFER", value: :umbellifer
    value "LEGUME", value: "bean & friends"
    value "CURCURBITS", value: 5
  end
end
RUBY

    run_generator(["Family",
      "NIGHTSHADE",
      "BRASSICA:Family::COLE",
      "UMBELLIFER::umbellifer",
      'LEGUME:"bean & friends"',
      "CURCURBITS:5"
    ])
    assert_file "app/graphql/types/family_type.rb", expected_content
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
graphql-1.8.18 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.11 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.10 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.9 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.8 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.7 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.6 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.5 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.4 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.3 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.2 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.8.17 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.8.16 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.1 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.0 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.8.15 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.0.pre4 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.8.14 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.0.pre3 spec/integration/rails/generators/graphql/enum_generator_spec.rb
graphql-1.9.0.pre2 spec/integration/rails/generators/graphql/enum_generator_spec.rb