Sha256: 433ea9d5118c8c594f41a8ab17af6c315b9b800c8ce2de3be2fb27115ed86506
Contents?: true
Size: 1.91 KB
Versions: 17
Compression:
Stored size: 1.91 KB
Contents
require "integration_spec_helper" module NulogyMessageBusProducer module Subscriptions RSpec.describe Finder, :subscriptions do subject(:resolver) do described_class.new(NulogyMessageBusProducer.config) end context "when there are only self-serve subscriptions" do it "returns matching self-serve subscriptions" do create_subscriptions = [self_serve_subscription, self_serve_subscription] self_serve_subscription(event_type: "testUpdated") expect(resolver.for_schema_event("test", "testCreated")).to contain_exactly(*create_subscriptions) end end context "when there are only configured subscriptions" do it "returns matching configured subscriptions" do create_subscriptions = [configured_subscription, configured_subscription] configured_subscription(event_type: "testUpdated") expect(resolver.for_schema_event("test", "testCreated")).to contain_exactly(*create_subscriptions) end end context "with both present" do it "returns both" do sub_1 = self_serve_subscription sub_2 = configured_subscription expect(resolver.for_schema_event("test", "testCreated")).to contain_exactly( sub_1, sub_2 ) end context "when duplicate subscription ids are present" do it "return the configured one" do id = SecureRandom.uuid self_serve_subscription(subscription_id: id, topic_name: "self-served") configured_subscription(subscription_id: id, topic_name: "configured") # Since the IDs are the same, we need to match on attributes to show that are different expect(resolver.for_schema_event("test", "testCreated")).to contain_exactly( have_attributes(topic_name: "configured") ) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems