spec/generators/graphql/union_generator_spec.rb in graphql-1.8.1 vs spec/generators/graphql/union_generator_spec.rb in graphql-1.8.2
- old
+ new
@@ -12,12 +12,11 @@
# Ruby-style:
["Types::WingedCreatureType", "Types::InsectType", "Types::BirdType"],
]
expected_content = <<-RUBY
-Types::WingedCreatureType = GraphQL::UnionType.define do
- name "WingedCreature"
+class Types::WingedCreatureType < Types::BaseUnion
possible_types [Types::InsectType, Types::BirdType]
end
RUBY
commands.each do |c|
@@ -34,12 +33,11 @@
# Ruby-style:
["Types::WingedCreatureType"],
]
expected_content = <<-RUBY
-Types::WingedCreatureType = GraphQL::UnionType.define do
- name "WingedCreature"
+class Types::WingedCreatureType < Types::BaseUnion
end
RUBY
commands.each do |c|
prepare_destination
@@ -50,11 +48,10 @@
test "it accepts a user-specified directory" do
command = ["WingedCreature", "--directory", "app/mydirectory"]
expected_content = <<-RUBY
-Types::WingedCreatureType = GraphQL::UnionType.define do
- name "WingedCreature"
+class Types::WingedCreatureType < Types::BaseUnion
end
RUBY
prepare_destination
run_generator(command)