notifiable-rails 0.19.9 → 0.20.0

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -11
  3. data/app/controllers/notifiable/device_tokens_controller.rb +1 -1
  4. data/{lib/generators/notifiable/install/templates/create_notifiable_apps.rb → db/migrate/20131210115648_create_notifiable_apps.rb} +0 -0
  5. data/{lib/generators/notifiable/install/templates/create_notifiable_device_tokens.rb → db/migrate/20131210115649_create_notifiable_device_tokens.rb} +0 -0
  6. data/{lib/generators/notifiable/install/templates/create_notifiable_notifications.rb → db/migrate/20131210115650_create_notifiable_notifications.rb} +0 -0
  7. data/{lib/generators/notifiable/install/templates/create_notifiable_statuses.rb → db/migrate/20131210115651_create_notifiable_statuses.rb} +0 -0
  8. data/lib/notifiable/engine.rb +10 -0
  9. data/lib/notifiable/version.rb +1 -1
  10. data/spec/controllers/device_tokens_controller_spec.rb +114 -105
  11. data/spec/controllers/notifications_controller_spec.rb +45 -45
  12. data/spec/model/notifiable_app_spec.rb +25 -0
  13. data/spec/model/notifiable_spec.rb +25 -0
  14. data/spec/model/notification_spec.rb +105 -0
  15. data/spec/model/notifier_base_spec.rb +18 -0
  16. data/spec/spec_helper.rb +15 -1
  17. data/spec/test_app/app/controllers/application_controller.rb +2 -0
  18. data/spec/test_app/config/database.yml +6 -0
  19. data/spec/test_app/db/development.sqlite3 +0 -0
  20. data/spec/test_app/db/migrate/{20131210115648_create_users.rb → 20131210115652_create_users.rb} +0 -0
  21. data/spec/test_app/db/schema.rb +2 -2
  22. data/spec/test_app/db/test.sqlite3 +0 -0
  23. data/spec/test_app/log/development.log +186 -0
  24. data/spec/test_app/log/test.log +33197 -0
  25. metadata +48 -70
  26. data/spec/notifiable_app_spec.rb +0 -24
  27. data/spec/notifiable_spec.rb +0 -20
  28. data/spec/notification_spec.rb +0 -119
  29. data/spec/notifier_base_spec.rb +0 -27
  30. data/spec/test_app/db/migrate/20131210115649_create_notifiable_apps.rb +0 -10
  31. data/spec/test_app/db/migrate/20131228225139_create_notifiable_device_tokens.rb +0 -18
  32. data/spec/test_app/db/migrate/20131228225140_create_notifiable_notifications.rb +0 -26
  33. data/spec/test_app/db/migrate/20131229104039_create_notifiable_statuses.rb +0 -12
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Notifiable::NotifierBase do
4
-
5
- let(:notifiable_app) { FactoryGirl.create(:app, :configuration => {:configurable_mock => {:use_sandbox => true}}) }
6
- let(:notification) { FactoryGirl.create(:notification, :app => notifiable_app) }
7
- let(:notifier) { ConfigurableMockNotifier.new(Rails.env, notification) }
8
-
9
- before(:each) do
10
- ConfigurableMockNotifier.send(:public, *ConfigurableMockNotifier.protected_instance_methods)
11
- end
12
-
13
- it "knows if the environment is test" do
14
- notifier.test_env?.should == true
15
- end
16
-
17
- it "configures a notifier" do
18
- notifiable_app.configure :configurable_mock, notifier
19
-
20
- notifier.use_sandbox.should == true
21
- end
22
-
23
- end
24
-
25
- class ConfigurableMockNotifier < Notifiable::NotifierBase
26
- attr_accessor :use_sandbox
27
- end
@@ -1,10 +0,0 @@
1
- class CreateNotifiableApps < ActiveRecord::Migration
2
- def change
3
- create_table :notifiable_apps do |t|
4
- t.string :name
5
- t.text :configuration
6
-
7
- t.timestamps
8
- end
9
- end
10
- end
@@ -1,18 +0,0 @@
1
- class CreateNotifiableDeviceTokens < ActiveRecord::Migration
2
-
3
- def change
4
- create_table :notifiable_device_tokens do |t|
5
- t.string :token
6
- t.string :provider
7
- t.boolean :is_valid, :default => true
8
- t.integer :user_id
9
- t.references :app
10
-
11
- t.timestamps
12
- end
13
-
14
- add_index :notifiable_device_tokens, :token
15
- add_index :notifiable_device_tokens, :user_id
16
- end
17
-
18
- end
@@ -1,26 +0,0 @@
1
- class CreateNotifiableNotifications < ActiveRecord::Migration
2
-
3
- def change
4
- create_table :notifiable_notifications do |t|
5
- t.text :message
6
- t.text :params
7
- t.references :app
8
-
9
- #stats
10
- t.integer :sent_count, :default => 0
11
- t.integer :gateway_accepted_count, :default => 0
12
- t.integer :opened_count, :default => 0
13
-
14
- # APNS - Optional
15
- #t.integer :badge
16
- #t.text :sound
17
- #t.datetime :expiry
18
-
19
- # MPNS - Optional
20
- #t.text :title
21
-
22
- t.timestamps
23
- end
24
- end
25
-
26
- end
@@ -1,12 +0,0 @@
1
- class CreateNotifiableStatuses < ActiveRecord::Migration
2
-
3
- def change
4
- create_table :notifiable_statuses do |t|
5
- t.references :notification
6
- t.references :device_token
7
- t.integer :status
8
- t.datetime :created_at
9
- end
10
- end
11
-
12
- end