hertz 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +21 -5
- data/Rakefile +4 -28
- data/lib/hertz/notifiable.rb +12 -7
- data/lib/hertz/version.rb +1 -1
- data/spec/dummy/config/application.rb +0 -4
- data/spec/dummy/config/environments/test.rb +2 -2
- data/spec/dummy/log/development.log +55 -112
- data/spec/dummy/log/test.log +217 -2422
- data/spec/examples.txt +18 -16
- data/spec/hertz/notifiable_spec.rb +23 -4
- metadata +65 -59
data/spec/examples.txt
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
---------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/hertz/hertz_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/hertz/notifiable_spec.rb[1:1:1] | passed | 0.
|
5
|
-
./spec/hertz/notifiable_spec.rb[1:2:1]
|
6
|
-
./spec/hertz/
|
7
|
-
./spec/hertz/
|
8
|
-
./spec/hertz/notification_deliverer_spec.rb[1:1:
|
9
|
-
./spec/
|
10
|
-
./spec/
|
11
|
-
./spec/models/hertz/
|
12
|
-
./spec/models/hertz/
|
13
|
-
./spec/models/hertz/notification_spec.rb[1:
|
14
|
-
./spec/models/hertz/notification_spec.rb[1:
|
15
|
-
./spec/models/hertz/notification_spec.rb[1:
|
16
|
-
./spec/models/hertz/notification_spec.rb[1:
|
17
|
-
./spec/models/hertz/notification_spec.rb[1:
|
18
|
-
./spec/models/hertz/notification_spec.rb[1:
|
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 |
|
@@ -12,10 +12,29 @@ module Hertz
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#notify' do
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
before(:all) do
|
16
|
+
class TestNotification < Hertz::Notification; end
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'with a notification object' do
|
20
|
+
subject { -> { user.notify(TestNotification.new) } }
|
21
|
+
|
22
|
+
it 'notifies the receiver' do
|
23
|
+
expect(subject).to change(user.notifications, :count).by(1)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'with a notification class' do
|
28
|
+
subject { -> { user.notify(TestNotification, foo: 'bar') } }
|
29
|
+
|
30
|
+
it 'notifies the receiver' do
|
31
|
+
expect(subject).to change(user.notifications, :count).by(1)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'sets the provided meta' do
|
35
|
+
subject.call
|
36
|
+
expect(user.notifications.last.meta).to eq('foo' => 'bar')
|
37
|
+
end
|
19
38
|
end
|
20
39
|
end
|
21
40
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hertz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Desantis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.0.0
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 6.0.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 4.0.0
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 6.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rubocop
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,71 +267,71 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
267
|
version: '0'
|
262
268
|
requirements: []
|
263
269
|
rubyforge_project:
|
264
|
-
rubygems_version: 2.
|
270
|
+
rubygems_version: 2.6.8
|
265
271
|
signing_key:
|
266
272
|
specification_version: 4
|
267
273
|
summary: A Rails engine for in-app notifications.
|
268
274
|
test_files:
|
269
|
-
- spec/
|
270
|
-
- spec/
|
271
|
-
- spec/
|
272
|
-
- spec/
|
273
|
-
- spec/dummy/db/migrate/20160415175358_create_hertz_notifications.hertz.rb
|
274
|
-
- spec/dummy/db/migrate/20160415175837_create_users.rb
|
275
|
-
- spec/dummy/db/migrate/20160628084413_rename_notification_deliveries_to_deliveries.hertz.rb
|
276
|
-
- spec/dummy/db/migrate/20160627084119_create_hertz_notification_deliveries.hertz.rb
|
277
|
-
- spec/dummy/db/migrate/20160508094342_remove_email_from_users.rb
|
278
|
-
- spec/dummy/README.rdoc
|
279
|
-
- spec/dummy/public/500.html
|
280
|
-
- spec/dummy/public/422.html
|
281
|
-
- spec/dummy/public/favicon.ico
|
282
|
-
- spec/dummy/public/404.html
|
283
|
-
- spec/dummy/bin/setup
|
284
|
-
- spec/dummy/bin/rails
|
275
|
+
- spec/support/factory_girl.rb
|
276
|
+
- spec/support/database_cleaner.rb
|
277
|
+
- spec/support/faker.rb
|
278
|
+
- spec/support/shoulda.rb
|
285
279
|
- spec/dummy/bin/rake
|
286
280
|
- spec/dummy/bin/bundle
|
287
|
-
- spec/dummy/
|
288
|
-
- spec/dummy/
|
289
|
-
- spec/dummy/
|
290
|
-
- spec/dummy/
|
291
|
-
- spec/dummy/
|
292
|
-
- spec/dummy/
|
281
|
+
- spec/dummy/bin/setup
|
282
|
+
- spec/dummy/bin/rails
|
283
|
+
- spec/dummy/README.rdoc
|
284
|
+
- spec/dummy/log/test.log
|
285
|
+
- spec/dummy/log/development.log
|
286
|
+
- spec/dummy/Rakefile
|
287
|
+
- spec/dummy/app/assets/javascripts/application.js
|
288
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
289
|
+
- spec/dummy/app/helpers/application_helper.rb
|
290
|
+
- spec/dummy/app/models/test_notification.rb
|
291
|
+
- spec/dummy/app/models/user.rb
|
292
|
+
- spec/dummy/app/views/hertz/notification_mailer/test_notification.html.erb
|
293
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
294
|
+
- spec/dummy/app/controllers/application_controller.rb
|
295
|
+
- spec/dummy/config/application.rb
|
296
|
+
- spec/dummy/config/routes.rb
|
297
|
+
- spec/dummy/config/secrets.yml
|
293
298
|
- spec/dummy/config/database.yml
|
294
|
-
- spec/dummy/config/initializers/
|
299
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
300
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
301
|
+
- spec/dummy/config/initializers/session_store.rb
|
295
302
|
- spec/dummy/config/initializers/hertz.rb
|
296
303
|
- spec/dummy/config/initializers/assets.rb
|
297
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
298
304
|
- spec/dummy/config/initializers/mime_types.rb
|
299
|
-
- spec/dummy/config/initializers/
|
300
|
-
- spec/dummy/config/initializers/
|
305
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
306
|
+
- spec/dummy/config/initializers/inflections.rb
|
301
307
|
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
302
|
-
- spec/dummy/config/
|
303
|
-
- spec/dummy/config/secrets.yml
|
308
|
+
- spec/dummy/config/environment.rb
|
304
309
|
- spec/dummy/config/locales/en.yml
|
305
|
-
- spec/dummy/config/
|
306
|
-
- spec/dummy/config/
|
310
|
+
- spec/dummy/config/environments/development.rb
|
311
|
+
- spec/dummy/config/environments/production.rb
|
312
|
+
- spec/dummy/config/environments/test.rb
|
313
|
+
- spec/dummy/config/database.example.yml
|
314
|
+
- spec/dummy/config/boot.rb
|
315
|
+
- spec/dummy/public/favicon.ico
|
316
|
+
- spec/dummy/public/422.html
|
317
|
+
- spec/dummy/public/404.html
|
318
|
+
- spec/dummy/public/500.html
|
319
|
+
- spec/dummy/db/migrate/20160508094342_remove_email_from_users.rb
|
320
|
+
- spec/dummy/db/migrate/20160418122437_add_email_to_users.rb
|
321
|
+
- spec/dummy/db/migrate/20160415175358_create_hertz_notifications.hertz.rb
|
322
|
+
- spec/dummy/db/migrate/20160628084413_rename_notification_deliveries_to_deliveries.hertz.rb
|
323
|
+
- spec/dummy/db/migrate/20160415175837_create_users.rb
|
324
|
+
- spec/dummy/db/migrate/20160627084119_create_hertz_notification_deliveries.hertz.rb
|
325
|
+
- spec/dummy/db/schema.rb
|
307
326
|
- spec/dummy/config.ru
|
308
|
-
- spec/
|
309
|
-
- spec/dummy/log/test.log
|
310
|
-
- spec/dummy/app/helpers/application_helper.rb
|
311
|
-
- spec/dummy/app/controllers/application_controller.rb
|
312
|
-
- spec/dummy/app/models/user.rb
|
313
|
-
- spec/dummy/app/models/test_notification.rb
|
314
|
-
- spec/dummy/app/assets/javascripts/application.js
|
315
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
316
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
317
|
-
- spec/dummy/app/views/hertz/notification_mailer/test_notification.html.erb
|
318
|
-
- spec/dummy/Rakefile
|
319
|
-
- spec/support/database_cleaner.rb
|
320
|
-
- spec/support/faker.rb
|
321
|
-
- spec/support/shoulda.rb
|
322
|
-
- spec/support/factory_girl.rb
|
323
|
-
- spec/hertz/notification_deliverer_spec.rb
|
324
|
-
- spec/hertz/notifiable_spec.rb
|
325
|
-
- spec/hertz/hertz_spec.rb
|
326
|
-
- spec/models/hertz/delivery_spec.rb
|
327
|
-
- spec/models/hertz/notification_spec.rb
|
328
|
-
- spec/examples.txt
|
329
|
-
- spec/factories/hertz/deliveries.rb
|
327
|
+
- spec/spec_helper.rb
|
330
328
|
- spec/factories/hertz/notifications.rb
|
329
|
+
- spec/factories/hertz/deliveries.rb
|
331
330
|
- spec/factories/users.rb
|
331
|
+
- spec/examples.txt
|
332
|
+
- spec/models/hertz/notification_spec.rb
|
333
|
+
- spec/models/hertz/delivery_spec.rb
|
334
|
+
- spec/hertz/notification_deliverer_spec.rb
|
335
|
+
- spec/hertz/hertz_spec.rb
|
336
|
+
- spec/hertz/notifiable_spec.rb
|
337
|
+
- spec/rails_helper.rb
|