nulogy_message_bus_producer 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +126 -2
- data/lib/nulogy_message_bus_producer.rb +6 -1
- data/lib/nulogy_message_bus_producer/version.rb +1 -1
- data/spec/dummy/log/development.log +46 -0
- data/spec/dummy/log/test.log +2538 -0
- data/spec/integration/lib/nulogy_message_bus_producer/postgres_public_subscriptions_spec.rb +3 -15
- data/spec/integration/lib/nulogy_message_bus_producer/repopulate_replication_slots_spec.rb +0 -4
- data/spec/integration/lib/nulogy_message_bus_producer/subscriber_graphql_schema_validator_spec.rb +0 -4
- data/spec/support/test_graphql_schema.rb +5 -2
- data/spec/unit/lib/nulogy_message_bus_producer/public_subscription_spec.rb +0 -4
- metadata +2 -16
@@ -3,25 +3,15 @@ require "integration_spec_helper"
|
|
3
3
|
RSpec.describe NulogyMessageBusProducer::PostgresPublicSubscriptions do
|
4
4
|
context "when the class is not registered" do
|
5
5
|
it "raises" do
|
6
|
-
unregistered_schema = Class.new(GraphQL::Schema) do
|
7
|
-
use(NulogyMessageBusProducer::PostgresPublicSubscriptions)
|
8
|
-
end
|
9
|
-
|
10
6
|
expect do
|
11
|
-
|
12
|
-
|
7
|
+
Class.new(GraphQL::Schema) do
|
8
|
+
use(NulogyMessageBusProducer::PostgresPublicSubscriptions)
|
9
|
+
end
|
13
10
|
end.to raise_error(KeyError, /The schema registry did not contain an entry/)
|
14
11
|
end
|
15
12
|
end
|
16
13
|
|
17
14
|
context "when subscription is triggered" do
|
18
|
-
before do
|
19
|
-
NulogyMessageBusProducer.config.register_schema(
|
20
|
-
schema: "NulogyMessageBusProducer::Specs::TestSchema",
|
21
|
-
key: "test"
|
22
|
-
)
|
23
|
-
end
|
24
|
-
|
25
15
|
it "generates events" do
|
26
16
|
create_subscription(event_type: "testCreated")
|
27
17
|
create_subscription(event_type: "testCreated")
|
@@ -72,8 +62,6 @@ RSpec.describe NulogyMessageBusProducer::PostgresPublicSubscriptions do
|
|
72
62
|
end
|
73
63
|
|
74
64
|
def trigger_erroneous_subscription
|
75
|
-
NulogyMessageBusProducer.config.register_schema(schema: "NulogyMessageBusProducer::Specs::TestSchema", key: "test")
|
76
|
-
|
77
65
|
event_type = "testCreated"
|
78
66
|
|
79
67
|
subscription = create_subscription(event_type: event_type)
|
@@ -11,10 +11,6 @@ RSpec.describe NulogyMessageBusProducer::RepopulateReplicationSlots do
|
|
11
11
|
let(:topic_name) { "repopulate_replication_slot_tests" }
|
12
12
|
|
13
13
|
before do
|
14
|
-
NulogyMessageBusProducer.config.register_schema(
|
15
|
-
schema: "NulogyMessageBusProducer::Specs::TestSchema",
|
16
|
-
key: "test"
|
17
|
-
)
|
18
14
|
cleanup_everything
|
19
15
|
end
|
20
16
|
|
data/spec/integration/lib/nulogy_message_bus_producer/subscriber_graphql_schema_validator_spec.rb
CHANGED
@@ -3,10 +3,6 @@ require "integration_spec_helper"
|
|
3
3
|
RSpec.describe NulogyMessageBusProducer::SubscriberGraphqlSchemaValidator do
|
4
4
|
subject(:validator) { NulogyMessageBusProducer::SubscriberGraphqlSchemaValidator.new }
|
5
5
|
|
6
|
-
before do
|
7
|
-
NulogyMessageBusProducer.config.register_schema(schema: "NulogyMessageBusProducer::Specs::TestSchema", key: "test")
|
8
|
-
end
|
9
|
-
|
10
6
|
describe "#validate" do
|
11
7
|
context "when a valid query is present" do
|
12
8
|
it "return true" do
|
@@ -1,4 +1,9 @@
|
|
1
1
|
# Some test GraphQL objects for testing
|
2
|
+
NulogyMessageBusProducer.config.register_schema(
|
3
|
+
schema: "NulogyMessageBusProducer::Specs::TestSchema",
|
4
|
+
key: "test"
|
5
|
+
)
|
6
|
+
|
2
7
|
module NulogyMessageBusProducer
|
3
8
|
module Specs
|
4
9
|
class TestObject < GraphQL::Schema::Object
|
@@ -24,8 +29,6 @@ module NulogyMessageBusProducer
|
|
24
29
|
end
|
25
30
|
|
26
31
|
class TestSubscription < GraphQL::Schema::Object
|
27
|
-
extend GraphQL::Subscriptions::SubscriptionRoot
|
28
|
-
|
29
32
|
field :test_created, subscription: TestCreated
|
30
33
|
end
|
31
34
|
|
@@ -2,10 +2,6 @@ require "unit_spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe NulogyMessageBusProducer::PublicSubscription do
|
4
4
|
context "when validating" do
|
5
|
-
before do
|
6
|
-
NulogyMessageBusProducer.config.register_schema schema: "NulogyMessageBusProducer::Specs::TestSchema", key: "test"
|
7
|
-
end
|
8
|
-
|
9
5
|
it "is invalid with a blank query" do
|
10
6
|
model = NulogyMessageBusProducer::PublicSubscription.new(
|
11
7
|
schema_key: "test",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nulogy_message_bus_producer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nulogy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.11.2
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: strong_migrations
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.5.0
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.5.0
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: pg
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|