recoil 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +40 -0
  7. data/Rakefile +29 -0
  8. data/app/controllers/recoil/notifications_controller.rb +8 -0
  9. data/app/models/recoil/bounce.rb +4 -0
  10. data/bin/rails +12 -0
  11. data/bin/rspec +16 -0
  12. data/config/routes.rb +3 -0
  13. data/db/migrate/20150305152728_add_emails_table.rb +10 -0
  14. data/lib/recoil/delivery_method.rb +16 -0
  15. data/lib/recoil/email.rb +11 -0
  16. data/lib/recoil/engine.rb +11 -0
  17. data/lib/recoil/message/abstract.rb +15 -0
  18. data/lib/recoil/message/notification.rb +18 -0
  19. data/lib/recoil/message/subscription_confirmation.rb +17 -0
  20. data/lib/recoil/message/unsubscribe_confirmation.rb +11 -0
  21. data/lib/recoil/message.rb +16 -0
  22. data/lib/recoil/version.rb +3 -0
  23. data/lib/recoil.rb +13 -0
  24. data/recoil.gemspec +28 -0
  25. data/spec/dummy/README.rdoc +28 -0
  26. data/spec/dummy/Rakefile +6 -0
  27. data/spec/dummy/app/assets/images/.keep +0 -0
  28. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  29. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  30. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  31. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  32. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  33. data/spec/dummy/app/mailers/.keep +0 -0
  34. data/spec/dummy/app/models/.keep +0 -0
  35. data/spec/dummy/app/models/concerns/.keep +0 -0
  36. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  37. data/spec/dummy/bin/bundle +3 -0
  38. data/spec/dummy/bin/rails +4 -0
  39. data/spec/dummy/bin/rake +4 -0
  40. data/spec/dummy/bin/setup +29 -0
  41. data/spec/dummy/config/application.rb +26 -0
  42. data/spec/dummy/config/boot.rb +5 -0
  43. data/spec/dummy/config/database.yml +25 -0
  44. data/spec/dummy/config/environment.rb +5 -0
  45. data/spec/dummy/config/environments/development.rb +41 -0
  46. data/spec/dummy/config/environments/production.rb +79 -0
  47. data/spec/dummy/config/environments/test.rb +42 -0
  48. data/spec/dummy/config/initializers/assets.rb +11 -0
  49. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  50. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  51. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  52. data/spec/dummy/config/initializers/inflections.rb +16 -0
  53. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  54. data/spec/dummy/config/initializers/session_store.rb +3 -0
  55. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  56. data/spec/dummy/config/locales/en.yml +23 -0
  57. data/spec/dummy/config/routes.rb +3 -0
  58. data/spec/dummy/config/secrets.yml +22 -0
  59. data/spec/dummy/config.ru +4 -0
  60. data/spec/dummy/db/development.sqlite3 +0 -0
  61. data/spec/dummy/db/schema.rb +23 -0
  62. data/spec/dummy/db/test.sqlite3 +0 -0
  63. data/spec/dummy/lib/assets/.keep +0 -0
  64. data/spec/dummy/public/404.html +67 -0
  65. data/spec/dummy/public/422.html +67 -0
  66. data/spec/dummy/public/500.html +66 -0
  67. data/spec/dummy/public/favicon.ico +0 -0
  68. data/spec/fixtures/vcr_cassettes/Recoil_Message_SubscriptionConfirmation/performs_a_http_get_on_the_url.yml +66 -0
  69. data/spec/recoil/email_spec.rb +28 -0
  70. data/spec/recoil/message/notification_spec.rb +23 -0
  71. data/spec/recoil/message/subscription_confirmation_spec.rb +12 -0
  72. data/spec/recoil/message_spec.rb +25 -0
  73. data/spec/recoil_spec.rb +1 -0
  74. data/spec/requests/receive_notification_spec.rb +24 -0
  75. data/spec/spec_helper.rb +35 -0
  76. metadata +269 -0
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe 'Receive notification', type: :request do
4
+ it 'adds notifications to the database' do
5
+ body = {
6
+ "Type" => "Notification",
7
+ "MessageId" => "id",
8
+ "TopicArn" => "arn:aws:sns:",
9
+ "Message" => "{\"notificationType\":\"Bounce\",\"bounce\":{\"bounceSubType\":\"Undetermined\",\"bounceType\":\"Undetermined\",\"bouncedRecipients\":[{\"emailAddress\":\"example@example.com\"}],\"timestamp\":\"2015-03-05T13:36:37.000Z\",\"feedbackId\":\"ID\"},\"mail\":{\"timestamp\":\"2015-03-05T13:36:34.000Z\",\"destination\":[\"example@example.com\"],\"messageId\":\"ID\",\"source\":\"SES\"}}",
10
+ "Timestamp" => "2015-03-05T13:36:39.002Z",
11
+ "SignatureVersion" => "1",
12
+ "Signature" => "Sig",
13
+ "SigningCertURL" => "https",
14
+ "UnsubscribeURL" => "https"
15
+ }
16
+
17
+ expect {
18
+ post '/ses', body
19
+ }.to change(Recoil::Bounce, :count).by(1)
20
+
21
+ expect(Recoil::Bounce.last.email).to eq 'example@example.com'
22
+ expect(Recoil::Bounce.last.bounce_type).to eq 'Undetermined'
23
+ end
24
+ end
@@ -0,0 +1,35 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../')
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
+ ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
7
+ require 'vcr'
8
+ require 'rspec/rails'
9
+
10
+ RSpec.configure do |c|
11
+ c.expect_with :rspec do |expectations|
12
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
13
+ end
14
+
15
+ c.filter_run :focus
16
+ c.run_all_when_everything_filtered = true
17
+
18
+ c.disable_monkey_patching!
19
+
20
+ c.warnings = true
21
+
22
+ if c.files_to_run.one?
23
+ c.default_formatter = 'doc'
24
+ end
25
+
26
+ c.order = :random
27
+
28
+ Kernel.srand c.seed
29
+ end
30
+
31
+ VCR.configure do |c|
32
+ c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
33
+ c.hook_into :webmock
34
+ c.configure_rspec_metadata!
35
+ end
metadata ADDED
@@ -0,0 +1,269 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: recoil
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brightin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.60'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.60'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.2.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.2.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: vcr
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 2.9.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 2.9.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.20.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.20.0
111
+ description: Send emails with Amazon SES with automatic blacklisting
112
+ email:
113
+ - developers@brightin.nl
114
+ executables:
115
+ - rails
116
+ - rspec
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - ".gitignore"
121
+ - ".rspec"
122
+ - Gemfile
123
+ - LICENSE.txt
124
+ - README.md
125
+ - Rakefile
126
+ - app/controllers/recoil/notifications_controller.rb
127
+ - app/models/recoil/bounce.rb
128
+ - bin/rails
129
+ - bin/rspec
130
+ - config/routes.rb
131
+ - db/migrate/20150305152728_add_emails_table.rb
132
+ - lib/recoil.rb
133
+ - lib/recoil/delivery_method.rb
134
+ - lib/recoil/email.rb
135
+ - lib/recoil/engine.rb
136
+ - lib/recoil/message.rb
137
+ - lib/recoil/message/abstract.rb
138
+ - lib/recoil/message/notification.rb
139
+ - lib/recoil/message/subscription_confirmation.rb
140
+ - lib/recoil/message/unsubscribe_confirmation.rb
141
+ - lib/recoil/version.rb
142
+ - recoil.gemspec
143
+ - spec/dummy/README.rdoc
144
+ - spec/dummy/Rakefile
145
+ - spec/dummy/app/assets/images/.keep
146
+ - spec/dummy/app/assets/javascripts/application.js
147
+ - spec/dummy/app/assets/stylesheets/application.css
148
+ - spec/dummy/app/controllers/application_controller.rb
149
+ - spec/dummy/app/controllers/concerns/.keep
150
+ - spec/dummy/app/helpers/application_helper.rb
151
+ - spec/dummy/app/mailers/.keep
152
+ - spec/dummy/app/models/.keep
153
+ - spec/dummy/app/models/concerns/.keep
154
+ - spec/dummy/app/views/layouts/application.html.erb
155
+ - spec/dummy/bin/bundle
156
+ - spec/dummy/bin/rails
157
+ - spec/dummy/bin/rake
158
+ - spec/dummy/bin/setup
159
+ - spec/dummy/config.ru
160
+ - spec/dummy/config/application.rb
161
+ - spec/dummy/config/boot.rb
162
+ - spec/dummy/config/database.yml
163
+ - spec/dummy/config/environment.rb
164
+ - spec/dummy/config/environments/development.rb
165
+ - spec/dummy/config/environments/production.rb
166
+ - spec/dummy/config/environments/test.rb
167
+ - spec/dummy/config/initializers/assets.rb
168
+ - spec/dummy/config/initializers/backtrace_silencers.rb
169
+ - spec/dummy/config/initializers/cookies_serializer.rb
170
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
171
+ - spec/dummy/config/initializers/inflections.rb
172
+ - spec/dummy/config/initializers/mime_types.rb
173
+ - spec/dummy/config/initializers/session_store.rb
174
+ - spec/dummy/config/initializers/wrap_parameters.rb
175
+ - spec/dummy/config/locales/en.yml
176
+ - spec/dummy/config/routes.rb
177
+ - spec/dummy/config/secrets.yml
178
+ - spec/dummy/db/development.sqlite3
179
+ - spec/dummy/db/schema.rb
180
+ - spec/dummy/db/test.sqlite3
181
+ - spec/dummy/lib/assets/.keep
182
+ - spec/dummy/public/404.html
183
+ - spec/dummy/public/422.html
184
+ - spec/dummy/public/500.html
185
+ - spec/dummy/public/favicon.ico
186
+ - spec/fixtures/vcr_cassettes/Recoil_Message_SubscriptionConfirmation/performs_a_http_get_on_the_url.yml
187
+ - spec/recoil/email_spec.rb
188
+ - spec/recoil/message/notification_spec.rb
189
+ - spec/recoil/message/subscription_confirmation_spec.rb
190
+ - spec/recoil/message_spec.rb
191
+ - spec/recoil_spec.rb
192
+ - spec/requests/receive_notification_spec.rb
193
+ - spec/spec_helper.rb
194
+ homepage: http://www.brightin.nl
195
+ licenses:
196
+ - MIT
197
+ metadata: {}
198
+ post_install_message:
199
+ rdoc_options: []
200
+ require_paths:
201
+ - lib
202
+ required_ruby_version: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ required_rubygems_version: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: '0'
212
+ requirements: []
213
+ rubyforge_project:
214
+ rubygems_version: 2.4.5
215
+ signing_key:
216
+ specification_version: 4
217
+ summary: Send emails with Amazon SES with automatic blacklisting
218
+ test_files:
219
+ - spec/dummy/README.rdoc
220
+ - spec/dummy/Rakefile
221
+ - spec/dummy/app/assets/images/.keep
222
+ - spec/dummy/app/assets/javascripts/application.js
223
+ - spec/dummy/app/assets/stylesheets/application.css
224
+ - spec/dummy/app/controllers/application_controller.rb
225
+ - spec/dummy/app/controllers/concerns/.keep
226
+ - spec/dummy/app/helpers/application_helper.rb
227
+ - spec/dummy/app/mailers/.keep
228
+ - spec/dummy/app/models/.keep
229
+ - spec/dummy/app/models/concerns/.keep
230
+ - spec/dummy/app/views/layouts/application.html.erb
231
+ - spec/dummy/bin/bundle
232
+ - spec/dummy/bin/rails
233
+ - spec/dummy/bin/rake
234
+ - spec/dummy/bin/setup
235
+ - spec/dummy/config.ru
236
+ - spec/dummy/config/application.rb
237
+ - spec/dummy/config/boot.rb
238
+ - spec/dummy/config/database.yml
239
+ - spec/dummy/config/environment.rb
240
+ - spec/dummy/config/environments/development.rb
241
+ - spec/dummy/config/environments/production.rb
242
+ - spec/dummy/config/environments/test.rb
243
+ - spec/dummy/config/initializers/assets.rb
244
+ - spec/dummy/config/initializers/backtrace_silencers.rb
245
+ - spec/dummy/config/initializers/cookies_serializer.rb
246
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
247
+ - spec/dummy/config/initializers/inflections.rb
248
+ - spec/dummy/config/initializers/mime_types.rb
249
+ - spec/dummy/config/initializers/session_store.rb
250
+ - spec/dummy/config/initializers/wrap_parameters.rb
251
+ - spec/dummy/config/locales/en.yml
252
+ - spec/dummy/config/routes.rb
253
+ - spec/dummy/config/secrets.yml
254
+ - spec/dummy/db/development.sqlite3
255
+ - spec/dummy/db/schema.rb
256
+ - spec/dummy/db/test.sqlite3
257
+ - spec/dummy/lib/assets/.keep
258
+ - spec/dummy/public/404.html
259
+ - spec/dummy/public/422.html
260
+ - spec/dummy/public/500.html
261
+ - spec/dummy/public/favicon.ico
262
+ - spec/fixtures/vcr_cassettes/Recoil_Message_SubscriptionConfirmation/performs_a_http_get_on_the_url.yml
263
+ - spec/recoil/email_spec.rb
264
+ - spec/recoil/message/notification_spec.rb
265
+ - spec/recoil/message/subscription_confirmation_spec.rb
266
+ - spec/recoil/message_spec.rb
267
+ - spec/recoil_spec.rb
268
+ - spec/requests/receive_notification_spec.rb
269
+ - spec/spec_helper.rb