hertz 1.0.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +27 -42
  3. data/Rakefile +5 -3
  4. data/app/models/hertz/delivery.rb +1 -0
  5. data/app/models/hertz/notification.rb +2 -0
  6. data/db/migrate/20160415174901_create_hertz_notifications.rb +1 -1
  7. data/db/migrate/20160627084018_create_hertz_notification_deliveries.rb +1 -1
  8. data/db/migrate/20160628084342_rename_notification_deliveries_to_deliveries.rb +1 -1
  9. data/lib/generators/hertz/install_generator.rb +2 -1
  10. data/lib/generators/hertz/templates/initializer.rb +1 -0
  11. data/lib/hertz.rb +1 -0
  12. data/lib/hertz/engine.rb +1 -0
  13. data/lib/hertz/notifiable.rb +1 -0
  14. data/lib/hertz/notification_deliverer.rb +2 -1
  15. data/lib/hertz/version.rb +2 -1
  16. data/spec/dummy/config/database.travis.yml +4 -0
  17. data/spec/factories/hertz/deliveries.rb +3 -2
  18. data/spec/factories/hertz/notifications.rb +3 -2
  19. data/spec/factories/users.rb +2 -1
  20. data/spec/hertz/hertz_spec.rb +2 -1
  21. data/spec/hertz/notifiable_spec.rb +25 -26
  22. data/spec/hertz/notification_deliverer_spec.rb +40 -47
  23. data/spec/models/hertz/notification_spec.rb +67 -57
  24. data/spec/spec_helper.rb +3 -0
  25. data/spec/support/factory_bot.rb +5 -0
  26. metadata +57 -72
  27. data/app/assets/javascripts/hertz/application.js +0 -13
  28. data/app/assets/stylesheets/hertz/application.css +0 -15
  29. data/app/controllers/hertz/application_controller.rb +0 -6
  30. data/app/helpers/hertz/application_helper.rb +0 -5
  31. data/app/views/layouts/hertz/application.html.erb +0 -14
  32. data/spec/dummy/config/database.yml +0 -19
  33. data/spec/dummy/log/development.log +0 -61
  34. data/spec/dummy/log/test.log +0 -217
  35. data/spec/examples.txt +0 -20
  36. data/spec/models/hertz/delivery_spec.rb +0 -12
  37. data/spec/support/factory_girl.rb +0 -5
  38. data/spec/support/shoulda.rb +0 -8
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- module Hertz
3
- class ApplicationController < ActionController::Base
4
- protect_from_forgery with: :exception
5
- end
6
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
- module Hertz
3
- module ApplicationHelper
4
- end
5
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Hertz</title>
5
- <%= stylesheet_link_tag "hertz/application", media: "all" %>
6
- <%= javascript_include_tag "hertz/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,19 +0,0 @@
1
- default: &default
2
- adapter: postgresql
3
- host: localhost
4
- username: postgres
5
- password: postgres
6
- pool: 5
7
- timeout: 5000
8
-
9
- development:
10
- <<: *default
11
- database: hertz_development
12
-
13
- test:
14
- <<: *default
15
- database: hertz_test
16
-
17
- production:
18
- <<: *default
19
- database: hertz_production
@@ -1,61 +0,0 @@
1
- SQL (1.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
2
- SQL (12.8ms) CREATE EXTENSION IF NOT EXISTS "hstore"
3
-  (6.5ms) CREATE TABLE "hertz_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL)
4
-  (1.8ms) CREATE UNIQUE INDEX "index_hertz_notification_deliveries_on_notification_and_courier" ON "hertz_deliveries" USING btree ("notification_id", "courier")
5
-  (1.4ms) CREATE INDEX "index_hertz_deliveries_on_notification_id" ON "hertz_deliveries" USING btree ("notification_id")
6
-  (3.6ms) CREATE TABLE "hertz_notifications" ("id" serial primary key, "type" character varying NOT NULL, "receiver_type" character varying NOT NULL, "receiver_id" integer NOT NULL, "meta" hstore DEFAULT '' NOT NULL, "read_at" timestamp, "created_at" timestamp NOT NULL)
7
-  (1.9ms) CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
8
-  (3.2ms) ALTER TABLE "hertz_deliveries" ADD CONSTRAINT "fk_rails_eefe07f4cd"
9
- FOREIGN KEY ("notification_id")
10
- REFERENCES "hertz_notifications" ("id")
11
- ON DELETE CASCADE
12
-  (5.9ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
13
-  (0.3ms) SELECT version FROM "schema_migrations"
14
-  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20160628084413')
15
-  (0.4ms) INSERT INTO schema_migrations (version) VALUES
16
- ('20160508094342'),
17
- ('20160418122437'),
18
- ('20160415175358'),
19
- ('20160415175837'),
20
- ('20160627084119');
21
-
22
- 
23
-  (2.4ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
24
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
25
-  (0.1ms) BEGIN
26
- SQL (0.2ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", 2017-01-19 15:22:12 UTC], ["updated_at", 2017-01-19 15:22:12 UTC]]
27
-  (0.4ms) COMMIT
28
- ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
29
-  (0.1ms) BEGIN
30
-  (0.1ms) COMMIT
31
- SQL (0.2ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
32
- SQL (10.1ms) CREATE EXTENSION IF NOT EXISTS "hstore"
33
-  (5.2ms) CREATE TABLE "hertz_deliveries" ("id" serial primary key, "notification_id" integer NOT NULL, "courier" character varying NOT NULL, "created_at" timestamp NOT NULL)
34
-  (1.7ms) CREATE UNIQUE INDEX "index_hertz_notification_deliveries_on_notification_and_courier" ON "hertz_deliveries" USING btree ("notification_id", "courier")
35
-  (2.8ms) CREATE INDEX "index_hertz_deliveries_on_notification_id" ON "hertz_deliveries" USING btree ("notification_id")
36
-  (4.2ms) CREATE TABLE "hertz_notifications" ("id" serial primary key, "type" character varying NOT NULL, "receiver_type" character varying NOT NULL, "receiver_id" integer NOT NULL, "meta" hstore DEFAULT '' NOT NULL, "read_at" timestamp, "created_at" timestamp NOT NULL)
37
-  (3.3ms) CREATE TABLE "users" ("id" serial primary key, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
38
-  (1.4ms) ALTER TABLE "hertz_deliveries" ADD CONSTRAINT "fk_rails_eefe07f4cd"
39
- FOREIGN KEY ("notification_id")
40
- REFERENCES "hertz_notifications" ("id")
41
- ON DELETE CASCADE
42
-  (3.7ms) CREATE TABLE "schema_migrations" ("version" character varying PRIMARY KEY)
43
-  (0.3ms) SELECT version FROM "schema_migrations"
44
-  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20160628084413')
45
-  (0.4ms) INSERT INTO schema_migrations (version) VALUES
46
- ('20160508094342'),
47
- ('20160418122437'),
48
- ('20160415175358'),
49
- ('20160415175837'),
50
- ('20160627084119');
51
-
52
- 
53
-  (3.3ms) CREATE TABLE "ar_internal_metadata" ("key" character varying PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
54
- ActiveRecord::InternalMetadata Load (2.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
55
-  (0.2ms) BEGIN
56
- SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", 2017-01-19 15:22:12 UTC], ["updated_at", 2017-01-19 15:22:12 UTC]]
57
-  (0.8ms) COMMIT
58
- ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", :environment], ["LIMIT", 1]]
59
-  (0.1ms) BEGIN
60
-  (0.1ms) COMMIT
61
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -1,217 +0,0 @@
1
- ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
-  (0.2ms) BEGIN
3
-  (0.4ms) ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
4
-  (5.6ms) COMMIT
5
-  (1.0ms)  SELECT schemaname || '.' || tablename
6
- FROM pg_tables
7
- WHERE
8
- tablename !~ '_prt_' AND
9
- tablename <> 'schema_migrations' AND
10
- schemaname = ANY (current_schemas(false))
11
- 
12
-  (1.1ms) select table_name from information_schema.views where table_schema = 'hertz_test'
13
-  (15.3ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
14
-  (1.7ms) BEGIN
15
-  (0.2ms) ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
16
-  (1.4ms) COMMIT
17
-  (0.2ms) BEGIN
18
-  (0.3ms) ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
19
-  (0.5ms) COMMIT
20
-  (9.6ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
21
-  (0.1ms) BEGIN
22
-  (0.2ms) ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
23
-  (0.3ms) COMMIT
24
-  (0.1ms) BEGIN
25
-  (0.2ms) ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
26
-  (0.4ms) COMMIT
27
-  (7.1ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
28
-  (0.1ms) BEGIN
29
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
30
-  (0.4ms) COMMIT
31
-  (0.1ms) BEGIN
32
-  (14.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
33
-  (0.5ms) COMMIT
34
-  (15.7ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
35
-  (0.2ms) BEGIN
36
-  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
37
-  (0.5ms) COMMIT
38
-  (0.2ms) BEGIN
39
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
40
-  (0.5ms) COMMIT
41
-  (8.4ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
42
-  (0.1ms) BEGIN
43
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
44
-  (0.4ms) COMMIT
45
-  (0.1ms) BEGIN
46
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
47
-  (0.5ms) COMMIT
48
-  (7.6ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
49
-  (0.1ms) BEGIN
50
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
51
-  (0.4ms) COMMIT
52
-  (0.1ms) BEGIN
53
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
54
-  (0.4ms) COMMIT
55
-  (7.3ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
56
-  (0.1ms) BEGIN
57
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
58
-  (0.4ms) COMMIT
59
-  (0.1ms) BEGIN
60
- SQL (11.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:16 UTC], ["updated_at", 2017-01-19 15:22:16 UTC]]
61
- SQL (0.3ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:16 UTC]]
62
-  (0.5ms) COMMIT
63
-  (0.1ms) BEGIN
64
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
65
-  (0.5ms) COMMIT
66
-  (9.8ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
67
-  (0.1ms) BEGIN
68
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
69
-  (0.4ms) COMMIT
70
-  (0.1ms) BEGIN
71
- SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:16 UTC], ["updated_at", 2017-01-19 15:22:16 UTC]]
72
- SQL (0.2ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:16 UTC]]
73
-  (0.8ms) COMMIT
74
-  (0.4ms) SELECT COUNT(*) FROM "hertz_deliveries" WHERE "hertz_deliveries"."notification_id" = $1 [["notification_id", 1]]
75
-  (0.1ms) BEGIN
76
- SQL (0.4ms) INSERT INTO "hertz_deliveries" ("notification_id", "courier", "created_at") VALUES ($1, $2, $3) RETURNING "id" [["notification_id", 1], ["courier", "test"], ["created_at", 2017-01-19 15:22:16 UTC]]
77
-  (0.7ms) COMMIT
78
-  (0.2ms) SELECT COUNT(*) FROM "hertz_deliveries" WHERE "hertz_deliveries"."notification_id" = $1 [["notification_id", 1]]
79
-  (0.1ms) BEGIN
80
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
81
-  (0.4ms) COMMIT
82
-  (9.4ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
83
-  (0.1ms) BEGIN
84
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
85
-  (0.7ms) COMMIT
86
-  (0.1ms) BEGIN
87
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
88
-  (0.4ms) COMMIT
89
-  (7.2ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
90
-  (0.1ms) BEGIN
91
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
92
-  (0.3ms) COMMIT
93
-  (0.1ms) BEGIN
94
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
95
-  (0.4ms) COMMIT
96
-  (7.0ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
97
-  (0.1ms) BEGIN
98
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
99
-  (0.3ms) COMMIT
100
-  (0.1ms) BEGIN
101
- SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
102
- SQL (0.3ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:17 UTC]]
103
-  (0.4ms) COMMIT
104
-  (0.1ms) BEGIN
105
- SQL (0.2ms) UPDATE "hertz_notifications" SET "read_at" = $1 WHERE "hertz_notifications"."id" = $2 [["read_at", 2017-01-19 15:22:17 UTC], ["id", 1]]
106
-  (0.4ms) COMMIT
107
-  (0.1ms) BEGIN
108
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
109
-  (0.3ms) COMMIT
110
-  (7.2ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
111
-  (0.1ms) BEGIN
112
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
113
-  (0.3ms) COMMIT
114
-  (0.1ms) BEGIN
115
- SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
116
- SQL (0.2ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:17 UTC]]
117
-  (0.4ms) COMMIT
118
-  (0.1ms) BEGIN
119
- SQL (0.1ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
120
- SQL (0.2ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "read_at", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 2], ["read_at", 2017-01-19 15:22:17 UTC], ["created_at", 2017-01-19 15:22:17 UTC]]
121
-  (0.3ms) COMMIT
122
- Hertz::Notification Load (0.1ms) SELECT "hertz_notifications".* FROM "hertz_notifications" WHERE (read_at IS NULL)
123
-  (0.1ms) BEGIN
124
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
125
-  (0.3ms) COMMIT
126
-  (7.0ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
127
-  (0.1ms) BEGIN
128
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
129
-  (0.4ms) COMMIT
130
-  (0.1ms) BEGIN
131
- SQL (0.4ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
132
- SQL (0.3ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "read_at", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["read_at", 2017-01-19 15:22:17 UTC], ["created_at", 2017-01-19 15:22:17 UTC]]
133
-  (0.8ms) COMMIT
134
-  (0.1ms) BEGIN
135
- SQL (0.3ms) UPDATE "hertz_notifications" SET "read_at" = $1 WHERE "hertz_notifications"."id" = $2 [["read_at", nil], ["id", 1]]
136
-  (0.7ms) COMMIT
137
-  (0.1ms) BEGIN
138
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
139
-  (0.4ms) COMMIT
140
-  (9.8ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
141
-  (0.2ms) BEGIN
142
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
143
-  (0.4ms) COMMIT
144
-  (0.1ms) BEGIN
145
- SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
146
- SQL (0.2ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:17 UTC]]
147
-  (0.4ms) COMMIT
148
- Hertz::Delivery Exists (0.4ms) SELECT 1 AS one FROM "hertz_deliveries" WHERE "hertz_deliveries"."notification_id" = $1 AND "hertz_deliveries"."courier" = $2 LIMIT $3 [["notification_id", 1], ["courier", :test], ["LIMIT", 1]]
149
-  (0.1ms) BEGIN
150
- SQL (0.4ms) INSERT INTO "hertz_deliveries" ("notification_id", "courier", "created_at") VALUES ($1, $2, $3) RETURNING "id" [["notification_id", 1], ["courier", "test"], ["created_at", 2017-01-19 15:22:17 UTC]]
151
-  (0.5ms) COMMIT
152
- Hertz::Delivery Exists (0.3ms) SELECT 1 AS one FROM "hertz_deliveries" WHERE "hertz_deliveries"."notification_id" = $1 AND "hertz_deliveries"."courier" = $2 LIMIT $3 [["notification_id", 1], ["courier", :test], ["LIMIT", 1]]
153
-  (0.1ms) BEGIN
154
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
155
-  (0.4ms) COMMIT
156
-  (7.6ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
157
-  (0.1ms) BEGIN
158
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
159
-  (0.4ms) COMMIT
160
-  (0.1ms) BEGIN
161
- SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
162
-  (0.4ms) COMMIT
163
-  (0.1ms) BEGIN
164
- SQL (0.4ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "meta", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["type", "Hertz::TestNotification"], ["receiver_type", "User"], ["receiver_id", 1], ["meta", "\"foo\"=>\"bar\""], ["created_at", 2017-01-19 15:22:17 UTC]]
165
-  (0.4ms) COMMIT
166
- Hertz::Notification Load (0.2ms) SELECT "hertz_notifications".* FROM "hertz_notifications" WHERE "hertz_notifications"."receiver_id" = $1 AND "hertz_notifications"."receiver_type" = $2 ORDER BY "hertz_notifications"."id" DESC LIMIT $3 [["receiver_id", 1], ["receiver_type", "User"], ["LIMIT", 1]]
167
-  (0.1ms) BEGIN
168
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
169
-  (0.4ms) COMMIT
170
-  (7.3ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
171
-  (0.1ms) BEGIN
172
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
173
-  (0.3ms) COMMIT
174
-  (0.1ms) BEGIN
175
- SQL (0.2ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
176
-  (0.4ms) COMMIT
177
-  (0.3ms) SELECT COUNT(*) FROM "hertz_notifications" WHERE "hertz_notifications"."receiver_id" = $1 AND "hertz_notifications"."receiver_type" = $2 [["receiver_id", 1], ["receiver_type", "User"]]
178
-  (0.1ms) BEGIN
179
- SQL (0.2ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "meta", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["type", "Hertz::TestNotification"], ["receiver_type", "User"], ["receiver_id", 1], ["meta", "\"foo\"=>\"bar\""], ["created_at", 2017-01-19 15:22:17 UTC]]
180
-  (0.4ms) COMMIT
181
-  (0.2ms) SELECT COUNT(*) FROM "hertz_notifications" WHERE "hertz_notifications"."receiver_id" = $1 AND "hertz_notifications"."receiver_type" = $2 [["receiver_id", 1], ["receiver_type", "User"]]
182
-  (0.1ms) BEGIN
183
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
184
-  (0.4ms) COMMIT
185
-  (7.1ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
186
-  (0.1ms) BEGIN
187
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
188
-  (0.4ms) COMMIT
189
-  (0.1ms) BEGIN
190
- SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
191
-  (0.4ms) COMMIT
192
-  (0.3ms) SELECT COUNT(*) FROM "hertz_notifications" WHERE "hertz_notifications"."receiver_id" = $1 AND "hertz_notifications"."receiver_type" = $2 [["receiver_id", 1], ["receiver_type", "User"]]
193
-  (0.1ms) BEGIN
194
- SQL (0.2ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::TestNotification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:17 UTC]]
195
-  (0.4ms) COMMIT
196
-  (0.2ms) SELECT COUNT(*) FROM "hertz_notifications" WHERE "hertz_notifications"."receiver_id" = $1 AND "hertz_notifications"."receiver_type" = $2 [["receiver_id", 1], ["receiver_type", "User"]]
197
-  (0.1ms) BEGIN
198
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
199
-  (0.4ms) COMMIT
200
-  (8.1ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
201
-  (0.1ms) BEGIN
202
-  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
203
-  (0.5ms) COMMIT
204
-  (0.1ms) BEGIN
205
- SQL (0.3ms) INSERT INTO "users" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", 2017-01-19 15:22:17 UTC], ["updated_at", 2017-01-19 15:22:17 UTC]]
206
-  (0.4ms) COMMIT
207
-  (0.1ms) BEGIN
208
- SQL (0.5ms) INSERT INTO "hertz_notifications" ("type", "receiver_type", "receiver_id", "created_at") VALUES ($1, $2, $3, $4) RETURNING "id" [["type", "Hertz::Notification"], ["receiver_type", "User"], ["receiver_id", 1], ["created_at", 2017-01-19 15:22:17 UTC]]
209
-  (0.5ms) COMMIT
210
- Hertz::Notification Load (0.1ms) SELECT "hertz_notifications".* FROM "hertz_notifications" WHERE "hertz_notifications"."receiver_id" = $1 AND "hertz_notifications"."receiver_type" = $2 [["receiver_id", 1], ["receiver_type", "User"]]
211
-  (0.1ms) BEGIN
212
-  (0.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" DISABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" DISABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" DISABLE TRIGGER ALL
213
-  (0.4ms) COMMIT
214
-  (8.6ms) TRUNCATE TABLE "public"."users", "public"."hertz_notifications", "public"."hertz_deliveries", "public"."ar_internal_metadata" RESTART IDENTITY CASCADE;
215
-  (0.1ms) BEGIN
216
-  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "users" ENABLE TRIGGER ALL;ALTER TABLE "hertz_notifications" ENABLE TRIGGER ALL;ALTER TABLE "hertz_deliveries" ENABLE TRIGGER ALL;ALTER TABLE "ar_internal_metadata" ENABLE TRIGGER ALL
217
-  (0.3ms) COMMIT
@@ -1,20 +0,0 @@
1
- example_id | status | run_time |
2
- ---------------------------------------------------- | ------ | --------------- |
3
- ./spec/hertz/hertz_spec.rb[1:1:1] | passed | 0.01802 seconds |
4
- ./spec/hertz/notifiable_spec.rb[1:1:1] | passed | 0.019 seconds |
5
- ./spec/hertz/notifiable_spec.rb[1:2:1:1] | passed | 0.01679 seconds |
6
- ./spec/hertz/notifiable_spec.rb[1:2:2:1] | passed | 0.01536 seconds |
7
- ./spec/hertz/notifiable_spec.rb[1:2:2:2] | passed | 0.01861 seconds |
8
- ./spec/hertz/notification_deliverer_spec.rb[1:1:1] | passed | 0.03229 seconds |
9
- ./spec/hertz/notification_deliverer_spec.rb[1:1:2:1] | passed | 0.03891 seconds |
10
- ./spec/hertz/notification_deliverer_spec.rb[1:1:2:2] | passed | 0.01805 seconds |
11
- ./spec/models/hertz/delivery_spec.rb[1:1] | passed | 0.01182 seconds |
12
- ./spec/models/hertz/delivery_spec.rb[1:2] | passed | 0.23544 seconds |
13
- ./spec/models/hertz/notification_spec.rb[1:1:1] | passed | 0.01033 seconds |
14
- ./spec/models/hertz/notification_spec.rb[1:2:1] | passed | 0.0108 seconds |
15
- ./spec/models/hertz/notification_spec.rb[1:3:1] | passed | 0.01516 seconds |
16
- ./spec/models/hertz/notification_spec.rb[1:4:1] | passed | 0.02185 seconds |
17
- ./spec/models/hertz/notification_spec.rb[1:5:1] | passed | 0.02218 seconds |
18
- ./spec/models/hertz/notification_spec.rb[1:6:1] | passed | 0.02557 seconds |
19
- ./spec/models/hertz/notification_spec.rb[1:7:1] | passed | 0.01615 seconds |
20
- ./spec/models/hertz/notification_spec.rb[1:8] | passed | 0.02893 seconds |
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module Hertz
3
- RSpec.describe Delivery do
4
- subject { build_stubbed(:delivery) }
5
-
6
- %w(notification courier).each do |attribute|
7
- it "validates the presence of #{attribute}" do
8
- expect(subject).to validate_presence_of(attribute)
9
- end
10
- end
11
- end
12
- end
@@ -1,5 +0,0 @@
1
- require 'factory_girl_rails'
2
-
3
- RSpec.configure do |config|
4
- config.include FactoryGirl::Syntax::Methods
5
- end
@@ -1,8 +0,0 @@
1
- require 'shoulda-matchers'
2
-
3
- Shoulda::Matchers.configure do |config|
4
- config.integrate do |with|
5
- with.test_framework :rspec
6
- with.library :rails
7
- end
8
- end