Sha256: 7f0b0c945d4e90150a02c18e50c450a5bad232048fa2d7caef6b3a1c974ac17c

Contents?: true

Size: 667 Bytes

Versions: 2

Compression:

Stored size: 667 Bytes

Contents

module SubscriptionHelpers
  def create_subscription(**overrides) # rubocop:disable Metrics/MethodLength
    args = {
      id: SecureRandom.uuid,
      subscription_group_id: SecureRandom.uuid,
      topic_name: "test_topic",
      schema_key: "test",
      event_type: "test_event_type",
      query: <<~GRAPHQL
        query ($id: UUID!) {
          foo (id: $id) {
            id
          }
        }
    GRAPHQL
    }.merge(overrides)

    NulogyMessageBusProducer::PublicSubscription.create!(args)
  end

  def trigger_event(event_name, object, args: {})
    NulogyMessageBusProducer::Specs::TestSchema.subscriptions.trigger(event_name, args, object)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nulogy_message_bus_producer-2.1.1 spec/support/subscription_helpers.rb
nulogy_message_bus_producer-2.1.0 spec/support/subscription_helpers.rb