custom_emails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/Rakefile +34 -0
  2. data/app/mailers/custom_emails/mailer.rb +22 -0
  3. data/app/models/custom_emails/email.rb +15 -0
  4. data/app/models/custom_emails/email_kind.rb +8 -0
  5. data/db/migrate/20131018141445_create_custom_emails_emails.rb +17 -0
  6. data/db/migrate/20131018143726_create_custom_emails_email_kinds.rb +17 -0
  7. data/lib/custom_emails.rb +12 -0
  8. data/lib/custom_emails/engine.rb +5 -0
  9. data/lib/custom_emails/models.rb +17 -0
  10. data/lib/custom_emails/orm/active_record.rb +1 -0
  11. data/lib/custom_emails/version.rb +3 -0
  12. data/lib/generators/custom_emails/install_generator.rb +11 -0
  13. data/lib/generators/templates/custom_emails.rb +21 -0
  14. data/lib/tasks/custom_emails_tasks.rake +4 -0
  15. data/test/custom_emails_test.rb +7 -0
  16. data/test/dummy/README.rdoc +28 -0
  17. data/test/dummy/Rakefile +6 -0
  18. data/test/dummy/app/assets/javascripts/application.js +13 -0
  19. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  20. data/test/dummy/app/controllers/application_controller.rb +5 -0
  21. data/test/dummy/app/helpers/application_helper.rb +2 -0
  22. data/test/dummy/app/models/example.rb +2 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/bin/bundle +3 -0
  25. data/test/dummy/bin/rails +4 -0
  26. data/test/dummy/bin/rake +4 -0
  27. data/test/dummy/config.ru +4 -0
  28. data/test/dummy/config/application.rb +23 -0
  29. data/test/dummy/config/boot.rb +5 -0
  30. data/test/dummy/config/database.yml +25 -0
  31. data/test/dummy/config/environment.rb +5 -0
  32. data/test/dummy/config/environments/development.rb +29 -0
  33. data/test/dummy/config/environments/production.rb +80 -0
  34. data/test/dummy/config/environments/test.rb +36 -0
  35. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  36. data/test/dummy/config/initializers/custom_emails.rb +10 -0
  37. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  38. data/test/dummy/config/initializers/inflections.rb +16 -0
  39. data/test/dummy/config/initializers/mime_types.rb +5 -0
  40. data/test/dummy/config/initializers/secret_token.rb +12 -0
  41. data/test/dummy/config/initializers/session_store.rb +3 -0
  42. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  43. data/test/dummy/config/locales/en.yml +23 -0
  44. data/test/dummy/config/routes.rb +56 -0
  45. data/test/dummy/db/development.sqlite3 +0 -0
  46. data/test/dummy/db/migrate/20131018164626_create_examples.rb +6 -0
  47. data/test/dummy/db/schema.rb +44 -0
  48. data/test/dummy/db/test.sqlite3 +0 -0
  49. data/test/dummy/log/development.log +1201 -0
  50. data/test/dummy/log/test.log +3167 -0
  51. data/test/dummy/public/404.html +58 -0
  52. data/test/dummy/public/422.html +58 -0
  53. data/test/dummy/public/500.html +57 -0
  54. data/test/dummy/public/favicon.ico +0 -0
  55. data/test/fixtures/custom_emails/email_kinds.yml +11 -0
  56. data/test/fixtures/custom_emails/emails.yml +0 -0
  57. data/test/integration/navigation_test.rb +10 -0
  58. data/test/lib/models_test.rb +53 -0
  59. data/test/mailers/custom_emails/mailer_test.rb +47 -0
  60. data/test/models/custom_emails/email_kind_test.rb +9 -0
  61. data/test/models/custom_emails/email_test.rb +42 -0
  62. data/test/test_helper.rb +16 -0
  63. data/test/test_models.rb +3 -0
  64. metadata +211 -0
@@ -0,0 +1,3167 @@
1
+  (0.2ms) begin transaction
2
+ ----------------------------
3
+ CustomEmailsTest: test_truth
4
+ ----------------------------
5
+  (0.0ms) rollback transaction
6
+  (0.2ms) begin transaction
7
+ ---------------------------------------
8
+ CustomEmails::EmailTest: test_the_truth
9
+ ---------------------------------------
10
+  (0.0ms) rollback transaction
11
+  (0.0ms) begin transaction
12
+ ----------------------------
13
+ CustomEmailsTest: test_truth
14
+ ----------------------------
15
+  (0.0ms) rollback transaction
16
+  (0.2ms) begin transaction
17
+ ---------------------------------------
18
+ CustomEmails::EmailTest: test_the_truth
19
+ ---------------------------------------
20
+  (0.0ms) rollback transaction
21
+  (0.0ms) begin transaction
22
+ ----------------------------
23
+ CustomEmailsTest: test_truth
24
+ ----------------------------
25
+  (0.0ms) rollback transaction
26
+  (0.3ms) begin transaction
27
+ -------------------------------------------------------------------
28
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
29
+ -------------------------------------------------------------------
30
+  (0.1ms) rollback transaction
31
+  (0.0ms) begin transaction
32
+ --------------------------------------------------------------------------------------------
33
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
34
+ --------------------------------------------------------------------------------------------
35
+  (0.1ms) rollback transaction
36
+  (0.0ms) begin transaction
37
+ ----------------------------
38
+ CustomEmailsTest: test_truth
39
+ ----------------------------
40
+  (0.0ms) rollback transaction
41
+  (0.0ms) begin transaction
42
+ --------------------------------------------------------------------------
43
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
44
+ --------------------------------------------------------------------------
45
+  (0.1ms) SAVEPOINT active_record_1
46
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
47
+ SQL (14.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:28:21 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:28:21 UTC +00:00]]
48
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49
+  (0.0ms) SAVEPOINT active_record_1
50
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:28:21 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:28:21 UTC +00:00]]
51
+  (0.0ms) RELEASE SAVEPOINT active_record_1
52
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
53
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
54
+
55
+ Sent mail to test@example.com (17.8ms)
56
+ Date: Mon, 21 Oct 2013 13:28:21 +0200
57
+ To: test@example.com
58
+ Message-ID: <52650fd565163_482f12f87fc76920@chocapic.mail>
59
+ Subject: Hello wold!
60
+ Mime-Version: 1.0
61
+ Content-Type: text/plain;
62
+ charset=UTF-8
63
+ Content-Transfer-Encoding: 7bit
64
+
65
+ Good luck...
66
+  (0.1ms) rollback transaction
67
+  (0.0ms) begin transaction
68
+ ------------------------------------------------------------------------------
69
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
70
+ ------------------------------------------------------------------------------
71
+  (0.0ms) rollback transaction
72
+  (0.5ms) begin transaction
73
+ -------------------------------------------------------------------
74
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
75
+ -------------------------------------------------------------------
76
+  (0.1ms) rollback transaction
77
+  (0.0ms) begin transaction
78
+ --------------------------------------------------------------------------------------------
79
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
80
+ --------------------------------------------------------------------------------------------
81
+  (0.1ms) rollback transaction
82
+  (0.0ms) begin transaction
83
+ ----------------------------
84
+ CustomEmailsTest: test_truth
85
+ ----------------------------
86
+  (0.0ms) rollback transaction
87
+  (0.0ms) begin transaction
88
+ --------------------------------------------------------------------------
89
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
90
+ --------------------------------------------------------------------------
91
+  (0.1ms) SAVEPOINT active_record_1
92
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
93
+ SQL (14.9ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:30:19 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:30:19 UTC +00:00]]
94
+  (0.1ms) RELEASE SAVEPOINT active_record_1
95
+  (0.0ms) SAVEPOINT active_record_1
96
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:30:20 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:30:20 UTC +00:00]]
97
+  (0.0ms) RELEASE SAVEPOINT active_record_1
98
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
99
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
100
+
101
+ Sent mail to test@example.com (18.0ms)
102
+ Date: Mon, 21 Oct 2013 13:30:20 +0200
103
+ From:
104
+ To: test@example.com
105
+ Message-ID: <5265104c3ba3_48858f37fc95869@chocapic.mail>
106
+ Subject: Hello wold!
107
+ Mime-Version: 1.0
108
+ Content-Type: text/plain;
109
+ charset=UTF-8
110
+ Content-Transfer-Encoding: 7bit
111
+
112
+ Good luck...
113
+  (0.1ms) rollback transaction
114
+  (0.0ms) begin transaction
115
+ ------------------------------------------------------------------------------
116
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
117
+ ------------------------------------------------------------------------------
118
+  (0.0ms) rollback transaction
119
+  (0.5ms) begin transaction
120
+ -------------------------------------------------------------------
121
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
122
+ -------------------------------------------------------------------
123
+  (0.1ms) rollback transaction
124
+  (0.0ms) begin transaction
125
+ --------------------------------------------------------------------------------------------
126
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
127
+ --------------------------------------------------------------------------------------------
128
+  (0.1ms) rollback transaction
129
+  (0.0ms) begin transaction
130
+ ----------------------------
131
+ CustomEmailsTest: test_truth
132
+ ----------------------------
133
+  (0.0ms) rollback transaction
134
+  (0.0ms) begin transaction
135
+ --------------------------------------------------------------------------
136
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
137
+ --------------------------------------------------------------------------
138
+  (0.1ms) SAVEPOINT active_record_1
139
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
140
+ SQL (14.7ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:31:24 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:31:24 UTC +00:00]]
141
+  (0.1ms) RELEASE SAVEPOINT active_record_1
142
+  (0.0ms) SAVEPOINT active_record_1
143
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:31:24 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:31:24 UTC +00:00]]
144
+  (0.0ms) RELEASE SAVEPOINT active_record_1
145
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
146
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
147
+
148
+ Sent mail to test@example.com (17.7ms)
149
+ Date: Mon, 21 Oct 2013 13:31:24 +0200
150
+ To: test@example.com
151
+ Message-ID: <5265108c92ddb_48ae62a7f0837df@chocapic.mail>
152
+ Subject: Hello wold!
153
+ Mime-Version: 1.0
154
+ Content-Type: text/plain;
155
+ charset=UTF-8
156
+ Content-Transfer-Encoding: 7bit
157
+
158
+ Good luck...
159
+  (0.1ms) rollback transaction
160
+  (0.0ms) begin transaction
161
+ ------------------------------------------------------------------------------
162
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
163
+ ------------------------------------------------------------------------------
164
+  (0.0ms) rollback transaction
165
+  (0.6ms) begin transaction
166
+ -------------------------------------------------------------------
167
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
168
+ -------------------------------------------------------------------
169
+  (0.1ms) rollback transaction
170
+  (0.0ms) begin transaction
171
+ --------------------------------------------------------------------------------------------
172
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
173
+ --------------------------------------------------------------------------------------------
174
+  (0.1ms) rollback transaction
175
+  (0.0ms) begin transaction
176
+ ----------------------------
177
+ CustomEmailsTest: test_truth
178
+ ----------------------------
179
+  (0.0ms) rollback transaction
180
+  (0.0ms) begin transaction
181
+ --------------------------------------------------------------------------
182
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
183
+ --------------------------------------------------------------------------
184
+  (0.1ms) SAVEPOINT active_record_1
185
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
186
+ SQL (14.5ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:32:49 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:32:49 UTC +00:00]]
187
+  (0.1ms) RELEASE SAVEPOINT active_record_1
188
+  (0.0ms) SAVEPOINT active_record_1
189
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:32:49 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:32:49 UTC +00:00]]
190
+  (0.0ms) RELEASE SAVEPOINT active_record_1
191
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
192
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
193
+
194
+ Sent mail to test@example.com (19.2ms)
195
+ Date: Mon, 21 Oct 2013 13:32:49 +0200
196
+ From: sender@example.org
197
+ To: test@example.com
198
+ Message-ID: <526510e1e48bb_48dca307f0183c@chocapic.mail>
199
+ Subject: Hello wold!
200
+ Mime-Version: 1.0
201
+ Content-Type: text/plain;
202
+ charset=UTF-8
203
+ Content-Transfer-Encoding: 7bit
204
+
205
+ Good luck...
206
+  (0.1ms) rollback transaction
207
+  (0.0ms) begin transaction
208
+ ------------------------------------------------------------------------------
209
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
210
+ ------------------------------------------------------------------------------
211
+  (0.0ms) rollback transaction
212
+  (0.3ms) begin transaction
213
+ -------------------------------------------------------------------
214
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
215
+ -------------------------------------------------------------------
216
+  (0.1ms) rollback transaction
217
+  (0.0ms) begin transaction
218
+ --------------------------------------------------------------------------------------------
219
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
220
+ --------------------------------------------------------------------------------------------
221
+  (0.1ms) rollback transaction
222
+  (0.0ms) begin transaction
223
+ ----------------------------
224
+ CustomEmailsTest: test_truth
225
+ ----------------------------
226
+  (0.0ms) rollback transaction
227
+  (0.0ms) begin transaction
228
+ --------------------------------------------------------------------------
229
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
230
+ --------------------------------------------------------------------------
231
+  (0.1ms) SAVEPOINT active_record_1
232
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
233
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:33:56 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:33:56 UTC +00:00]]
234
+  (0.0ms) RELEASE SAVEPOINT active_record_1
235
+  (0.0ms) SAVEPOINT active_record_1
236
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:33:56 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:33:56 UTC +00:00]]
237
+  (0.0ms) RELEASE SAVEPOINT active_record_1
238
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
239
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
240
+
241
+ Sent mail to test@example.com (6.2ms)
242
+ Date: Mon, 21 Oct 2013 13:33:56 +0200
243
+ From: sender@example.org
244
+ To: test@example.com
245
+ Message-ID: <52651124d4838_491413647f43440@chocapic.mail>
246
+ Subject: Hello wold!
247
+ Mime-Version: 1.0
248
+ Content-Type: text/plain;
249
+ charset=UTF-8
250
+ Content-Transfer-Encoding: 7bit
251
+
252
+ Good luck...
253
+  (0.3ms) rollback transaction
254
+  (0.1ms) begin transaction
255
+ ------------------------------------------------------------------------------
256
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
257
+ ------------------------------------------------------------------------------
258
+  (0.1ms) rollback transaction
259
+  (0.3ms) begin transaction
260
+ -------------------------------------------------------------------
261
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
262
+ -------------------------------------------------------------------
263
+  (0.1ms) rollback transaction
264
+  (0.0ms) begin transaction
265
+ --------------------------------------------------------------------------------------------
266
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
267
+ --------------------------------------------------------------------------------------------
268
+  (0.1ms) rollback transaction
269
+  (0.0ms) begin transaction
270
+ ----------------------------
271
+ CustomEmailsTest: test_truth
272
+ ----------------------------
273
+  (0.0ms) rollback transaction
274
+  (0.0ms) begin transaction
275
+ --------------------------------------------------------------------------
276
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
277
+ --------------------------------------------------------------------------
278
+  (0.1ms) SAVEPOINT active_record_1
279
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
280
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:34:48 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:34:48 UTC +00:00]]
281
+  (0.0ms) RELEASE SAVEPOINT active_record_1
282
+  (0.0ms) SAVEPOINT active_record_1
283
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:34:48 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:34:48 UTC +00:00]]
284
+  (0.0ms) RELEASE SAVEPOINT active_record_1
285
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
286
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
287
+
288
+ Sent mail to test@example.com (6.1ms)
289
+ Date: Mon, 21 Oct 2013 13:34:48 +0200
290
+ From: sender@example.org
291
+ To: test@example.com
292
+ Message-ID: <52651158e59f3_493f12b17f8377b4@chocapic.mail>
293
+ Subject: Hello wold!
294
+ Mime-Version: 1.0
295
+ Content-Type: text/plain;
296
+ charset=UTF-8
297
+ Content-Transfer-Encoding: 7bit
298
+
299
+ Good luck...
300
+  (0.1ms) rollback transaction
301
+  (0.0ms) begin transaction
302
+ ------------------------------------------------------------------------------
303
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
304
+ ------------------------------------------------------------------------------
305
+  (0.0ms) rollback transaction
306
+  (0.4ms) begin transaction
307
+ -------------------------------------------------------------------
308
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
309
+ -------------------------------------------------------------------
310
+  (0.1ms) rollback transaction
311
+  (0.0ms) begin transaction
312
+ --------------------------------------------------------------------------------------------
313
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
314
+ --------------------------------------------------------------------------------------------
315
+  (0.1ms) rollback transaction
316
+  (0.0ms) begin transaction
317
+ ----------------------------
318
+ CustomEmailsTest: test_truth
319
+ ----------------------------
320
+  (0.0ms) rollback transaction
321
+  (0.0ms) begin transaction
322
+ --------------------------------------------------------------------------
323
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
324
+ --------------------------------------------------------------------------
325
+  (0.1ms) SAVEPOINT active_record_1
326
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
327
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:35:03 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:35:03 UTC +00:00]]
328
+  (0.0ms) RELEASE SAVEPOINT active_record_1
329
+  (0.0ms) SAVEPOINT active_record_1
330
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:35:03 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:35:03 UTC +00:00]]
331
+  (0.0ms) RELEASE SAVEPOINT active_record_1
332
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
333
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
334
+
335
+ Sent mail to test@example.com (5.8ms)
336
+ Date: Mon, 21 Oct 2013 13:35:03 +0200
337
+ From: sender@example.org
338
+ To: test@example.com
339
+ Message-ID: <526511671bdea_4963d08ff423262@chocapic.mail>
340
+ Subject: Hello wold!
341
+ Mime-Version: 1.0
342
+ Content-Type: text/plain;
343
+ charset=UTF-8
344
+ Content-Transfer-Encoding: 7bit
345
+
346
+ Good luck...
347
+  (0.1ms) rollback transaction
348
+  (0.0ms) begin transaction
349
+ ------------------------------------------------------------------------------
350
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
351
+ ------------------------------------------------------------------------------
352
+  (0.0ms) rollback transaction
353
+  (0.3ms) begin transaction
354
+ -------------------------------------------------------------------
355
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
356
+ -------------------------------------------------------------------
357
+  (0.1ms) rollback transaction
358
+  (0.0ms) begin transaction
359
+ --------------------------------------------------------------------------------------------
360
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
361
+ --------------------------------------------------------------------------------------------
362
+  (0.1ms) rollback transaction
363
+  (0.0ms) begin transaction
364
+ ----------------------------
365
+ CustomEmailsTest: test_truth
366
+ ----------------------------
367
+  (0.0ms) rollback transaction
368
+  (0.0ms) begin transaction
369
+ --------------------------------------------------------------------------
370
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
371
+ --------------------------------------------------------------------------
372
+  (0.1ms) SAVEPOINT active_record_1
373
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
374
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:35:41 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:35:41 UTC +00:00]]
375
+  (0.0ms) RELEASE SAVEPOINT active_record_1
376
+  (0.0ms) SAVEPOINT active_record_1
377
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:35:41 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:35:41 UTC +00:00]]
378
+  (0.0ms) RELEASE SAVEPOINT active_record_1
379
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
380
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
381
+
382
+ Sent mail to test@example.com (6.1ms)
383
+ Date: Mon, 21 Oct 2013 13:35:41 +0200
384
+ From: sender@example.org
385
+ To: test@example.com
386
+ Message-ID: <5265118dc3928_498c5677f08565a@chocapic.mail>
387
+ Subject: Hello wold!
388
+ Mime-Version: 1.0
389
+ Content-Type: text/plain;
390
+ charset=UTF-8
391
+ Content-Transfer-Encoding: 7bit
392
+
393
+ Good luck...
394
+  (0.1ms) rollback transaction
395
+  (0.0ms) begin transaction
396
+ ------------------------------------------------------------------------------
397
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
398
+ ------------------------------------------------------------------------------
399
+  (0.0ms) rollback transaction
400
+  (0.3ms) begin transaction
401
+ -------------------------------------------------------------------
402
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
403
+ -------------------------------------------------------------------
404
+  (0.1ms) rollback transaction
405
+  (0.0ms) begin transaction
406
+ --------------------------------------------------------------------------------------------
407
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
408
+ --------------------------------------------------------------------------------------------
409
+  (0.1ms) rollback transaction
410
+  (0.0ms) begin transaction
411
+ ----------------------------
412
+ CustomEmailsTest: test_truth
413
+ ----------------------------
414
+  (0.0ms) rollback transaction
415
+  (0.0ms) begin transaction
416
+ --------------------------------------------------------------------------
417
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
418
+ --------------------------------------------------------------------------
419
+  (0.1ms) SAVEPOINT active_record_1
420
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
421
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:36:03 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:36:03 UTC +00:00]]
422
+  (0.0ms) RELEASE SAVEPOINT active_record_1
423
+  (0.0ms) SAVEPOINT active_record_1
424
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:36:03 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello wold!"], ["updated_at", Mon, 21 Oct 2013 11:36:03 UTC +00:00]]
425
+  (0.0ms) RELEASE SAVEPOINT active_record_1
426
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
427
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
428
+
429
+ Sent mail to test@example.com (5.8ms)
430
+ Date: Mon, 21 Oct 2013 13:36:03 +0200
431
+ From: sender@example.org
432
+ To: test@example.com
433
+ Message-ID: <526511a36624b_49b313b7800570b@chocapic.mail>
434
+ Subject: Hello wold!
435
+ Mime-Version: 1.0
436
+ Content-Type: text/plain;
437
+ charset=UTF-8
438
+ Content-Transfer-Encoding: 7bit
439
+
440
+ Good luck...
441
+  (0.3ms) rollback transaction
442
+  (0.1ms) begin transaction
443
+ ------------------------------------------------------------------------------
444
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
445
+ ------------------------------------------------------------------------------
446
+  (0.1ms) rollback transaction
447
+  (0.3ms) begin transaction
448
+ -------------------------------------------------------------------
449
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
450
+ -------------------------------------------------------------------
451
+  (0.1ms) rollback transaction
452
+  (0.0ms) begin transaction
453
+ --------------------------------------------------------------------------------------------
454
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
455
+ --------------------------------------------------------------------------------------------
456
+  (0.1ms) rollback transaction
457
+  (0.0ms) begin transaction
458
+ ----------------------------
459
+ CustomEmailsTest: test_truth
460
+ ----------------------------
461
+  (0.0ms) rollback transaction
462
+  (0.0ms) begin transaction
463
+ --------------------------------------------------------------------------
464
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
465
+ --------------------------------------------------------------------------
466
+  (0.1ms) SAVEPOINT active_record_1
467
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
468
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:38:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:38:39 UTC +00:00]]
469
+  (0.0ms) RELEASE SAVEPOINT active_record_1
470
+  (0.0ms) SAVEPOINT active_record_1
471
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:38:39 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:38:39 UTC +00:00]]
472
+  (0.0ms) RELEASE SAVEPOINT active_record_1
473
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
474
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
475
+
476
+ Sent mail to test@example.com (5.8ms)
477
+ Date: Mon, 21 Oct 2013 13:38:39 +0200
478
+ From: sender@example.org
479
+ To: test@example.com
480
+ Message-ID: <5265123fdf115_4a007bd7fc567b@chocapic.mail>
481
+ Subject: Hello world!
482
+ Mime-Version: 1.0
483
+ Content-Type: text/plain;
484
+ charset=UTF-8
485
+ Content-Transfer-Encoding: 7bit
486
+
487
+ Good luck...
488
+  (0.3ms) rollback transaction
489
+  (0.1ms) begin transaction
490
+ ------------------------------------------------------------------------------
491
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
492
+ ------------------------------------------------------------------------------
493
+  (0.1ms) rollback transaction
494
+  (0.4ms) begin transaction
495
+ -------------------------------------------------------------------
496
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
497
+ -------------------------------------------------------------------
498
+  (0.1ms) rollback transaction
499
+  (0.0ms) begin transaction
500
+ --------------------------------------------------------------------------------------------
501
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
502
+ --------------------------------------------------------------------------------------------
503
+  (0.1ms) rollback transaction
504
+  (0.0ms) begin transaction
505
+ ----------------------------
506
+ CustomEmailsTest: test_truth
507
+ ----------------------------
508
+  (0.0ms) rollback transaction
509
+  (0.0ms) begin transaction
510
+ ----------------------------------------------------------------------------------
511
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
512
+ ----------------------------------------------------------------------------------
513
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
514
+  (0.0ms) rollback transaction
515
+  (0.0ms) begin transaction
516
+ --------------------------------------------------------------------------
517
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
518
+ --------------------------------------------------------------------------
519
+  (0.0ms) SAVEPOINT active_record_1
520
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
521
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:42:23 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:42:23 UTC +00:00]]
522
+  (0.0ms) RELEASE SAVEPOINT active_record_1
523
+  (0.0ms) SAVEPOINT active_record_1
524
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:42:23 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:42:23 UTC +00:00]]
525
+  (0.0ms) RELEASE SAVEPOINT active_record_1
526
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
527
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
528
+
529
+ Sent mail to test@example.com (6.0ms)
530
+ Date: Mon, 21 Oct 2013 13:42:23 +0200
531
+ From: sender@example.org
532
+ To: test@example.com
533
+ Message-ID: <5265131f6c5ea_4a9010f6ff8459c5@chocapic.mail>
534
+ Subject: Hello world!
535
+ Mime-Version: 1.0
536
+ Content-Type: text/plain;
537
+ charset=UTF-8
538
+ Content-Transfer-Encoding: 7bit
539
+
540
+ Good luck...
541
+  (0.1ms) rollback transaction
542
+  (0.0ms) begin transaction
543
+ ------------------------------------------------------------------------------
544
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
545
+ ------------------------------------------------------------------------------
546
+  (0.0ms) rollback transaction
547
+  (0.3ms) begin transaction
548
+ -------------------------------------------------------------------
549
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
550
+ -------------------------------------------------------------------
551
+  (0.1ms) rollback transaction
552
+  (0.0ms) begin transaction
553
+ --------------------------------------------------------------------------------------------
554
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
555
+ --------------------------------------------------------------------------------------------
556
+  (0.1ms) rollback transaction
557
+  (0.0ms) begin transaction
558
+ ----------------------------
559
+ CustomEmailsTest: test_truth
560
+ ----------------------------
561
+  (0.0ms) rollback transaction
562
+  (0.0ms) begin transaction
563
+ ----------------------------------------------------------------------------------
564
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
565
+ ----------------------------------------------------------------------------------
566
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
567
+  (0.0ms) rollback transaction
568
+  (0.0ms) begin transaction
569
+ --------------------------------------------------------------------------
570
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
571
+ --------------------------------------------------------------------------
572
+  (0.0ms) SAVEPOINT active_record_1
573
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
574
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:43:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:43:15 UTC +00:00]]
575
+  (0.0ms) RELEASE SAVEPOINT active_record_1
576
+  (0.0ms) SAVEPOINT active_record_1
577
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:43:15 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:43:15 UTC +00:00]]
578
+  (0.1ms) RELEASE SAVEPOINT active_record_1
579
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
580
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
581
+
582
+ Sent mail to test@example.com (6.1ms)
583
+ Date: Mon, 21 Oct 2013 13:43:15 +0200
584
+ From: sender@example.org
585
+ To: test@example.com
586
+ Message-ID: <5265135345c2c_4aba60cffc140e0@chocapic.mail>
587
+ Subject: Hello world!
588
+ Mime-Version: 1.0
589
+ Content-Type: text/plain;
590
+ charset=UTF-8
591
+ Content-Transfer-Encoding: 7bit
592
+
593
+ Good luck...
594
+  (0.1ms) rollback transaction
595
+  (0.0ms) begin transaction
596
+ ------------------------------------------------------------------------------
597
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
598
+ ------------------------------------------------------------------------------
599
+  (0.0ms) rollback transaction
600
+  (0.3ms) begin transaction
601
+ -------------------------------------------------------------------
602
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
603
+ -------------------------------------------------------------------
604
+  (0.1ms) rollback transaction
605
+  (0.0ms) begin transaction
606
+ --------------------------------------------------------------------------------------------
607
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
608
+ --------------------------------------------------------------------------------------------
609
+  (0.1ms) rollback transaction
610
+  (0.0ms) begin transaction
611
+ ----------------------------
612
+ CustomEmailsTest: test_truth
613
+ ----------------------------
614
+  (0.0ms) rollback transaction
615
+  (0.0ms) begin transaction
616
+ ----------------------------------------------------------------------------------
617
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
618
+ ----------------------------------------------------------------------------------
619
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
620
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
621
+  (0.0ms) rollback transaction
622
+  (0.0ms) begin transaction
623
+ --------------------------------------------------------------------------
624
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
625
+ --------------------------------------------------------------------------
626
+  (0.0ms) SAVEPOINT active_record_1
627
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
628
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:43:55 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:43:55 UTC +00:00]]
629
+  (0.0ms) RELEASE SAVEPOINT active_record_1
630
+  (0.0ms) SAVEPOINT active_record_1
631
+ SQL (0.7ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:43:55 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:43:55 UTC +00:00]]
632
+  (0.1ms) RELEASE SAVEPOINT active_record_1
633
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
634
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
635
+
636
+ Sent mail to test@example.com (5.9ms)
637
+ Date: Mon, 21 Oct 2013 13:43:55 +0200
638
+ From: sender@example.org
639
+ To: test@example.com
640
+ Message-ID: <5265137b795aa_4af2d638001f@chocapic.mail>
641
+ Subject: Hello world!
642
+ Mime-Version: 1.0
643
+ Content-Type: text/plain;
644
+ charset=UTF-8
645
+ Content-Transfer-Encoding: 7bit
646
+
647
+ Good luck...
648
+  (0.1ms) rollback transaction
649
+  (0.0ms) begin transaction
650
+ ------------------------------------------------------------------------------
651
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
652
+ ------------------------------------------------------------------------------
653
+  (0.0ms) rollback transaction
654
+  (0.3ms) begin transaction
655
+ -------------------------------------------------------------------
656
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
657
+ -------------------------------------------------------------------
658
+  (0.1ms) rollback transaction
659
+  (0.0ms) begin transaction
660
+ --------------------------------------------------------------------------------------------
661
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
662
+ --------------------------------------------------------------------------------------------
663
+  (0.1ms) rollback transaction
664
+  (0.0ms) begin transaction
665
+ ----------------------------
666
+ CustomEmailsTest: test_truth
667
+ ----------------------------
668
+  (0.0ms) rollback transaction
669
+  (0.0ms) begin transaction
670
+ ----------------------------------------------------------------------------------
671
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
672
+ ----------------------------------------------------------------------------------
673
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
674
+  (0.0ms) SAVEPOINT active_record_1
675
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
676
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00]]
677
+  (0.0ms) RELEASE SAVEPOINT active_record_1
678
+  (0.0ms) SAVEPOINT active_record_1
679
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00]]
680
+  (0.0ms) RELEASE SAVEPOINT active_record_1
681
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
682
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
683
+  (0.1ms) rollback transaction
684
+  (0.1ms) begin transaction
685
+ --------------------------------------------------------------------------
686
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
687
+ --------------------------------------------------------------------------
688
+  (0.0ms) SAVEPOINT active_record_1
689
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
690
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00]]
691
+  (0.0ms) RELEASE SAVEPOINT active_record_1
692
+  (0.0ms) SAVEPOINT active_record_1
693
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:44:39 UTC +00:00]]
694
+  (0.0ms) RELEASE SAVEPOINT active_record_1
695
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
696
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
697
+
698
+ Sent mail to test@example.com (5.8ms)
699
+ Date: Mon, 21 Oct 2013 13:44:39 +0200
700
+ From: sender@example.org
701
+ To: test@example.com
702
+ Message-ID: <526513a7a07ce_4b1b5d8ff46094a@chocapic.mail>
703
+ Subject: Hello world!
704
+ Mime-Version: 1.0
705
+ Content-Type: text/plain;
706
+ charset=UTF-8
707
+ Content-Transfer-Encoding: 7bit
708
+
709
+ Good luck...
710
+  (0.1ms) rollback transaction
711
+  (0.0ms) begin transaction
712
+ ------------------------------------------------------------------------------
713
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
714
+ ------------------------------------------------------------------------------
715
+  (0.0ms) rollback transaction
716
+  (0.3ms) begin transaction
717
+ -------------------------------------------------------------------
718
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
719
+ -------------------------------------------------------------------
720
+  (0.1ms) rollback transaction
721
+  (0.0ms) begin transaction
722
+ --------------------------------------------------------------------------------------------
723
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
724
+ --------------------------------------------------------------------------------------------
725
+  (0.1ms) rollback transaction
726
+  (0.0ms) begin transaction
727
+ ----------------------------
728
+ CustomEmailsTest: test_truth
729
+ ----------------------------
730
+  (0.0ms) rollback transaction
731
+  (0.0ms) begin transaction
732
+ ----------------------------------------------------------------------------------
733
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
734
+ ----------------------------------------------------------------------------------
735
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
736
+  (0.0ms) SAVEPOINT active_record_1
737
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
738
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00]]
739
+  (0.0ms) RELEASE SAVEPOINT active_record_1
740
+  (0.0ms) SAVEPOINT active_record_1
741
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00]]
742
+  (0.0ms) RELEASE SAVEPOINT active_record_1
743
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
744
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
745
+  (0.1ms) rollback transaction
746
+  (0.0ms) begin transaction
747
+ --------------------------------------------------------------------------
748
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
749
+ --------------------------------------------------------------------------
750
+  (0.0ms) SAVEPOINT active_record_1
751
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
752
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00]]
753
+  (0.0ms) RELEASE SAVEPOINT active_record_1
754
+  (0.0ms) SAVEPOINT active_record_1
755
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:45:05 UTC +00:00]]
756
+  (0.0ms) RELEASE SAVEPOINT active_record_1
757
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
758
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
759
+
760
+ Sent mail to test@example.com (5.9ms)
761
+ Date: Mon, 21 Oct 2013 13:45:05 +0200
762
+ From: sender@example.org
763
+ To: test@example.com
764
+ Message-ID: <526513c161520_4b417627f838619@chocapic.mail>
765
+ Subject: Hello world!
766
+ Mime-Version: 1.0
767
+ Content-Type: text/plain;
768
+ charset=UTF-8
769
+ Content-Transfer-Encoding: 7bit
770
+
771
+ Good luck...
772
+  (0.1ms) rollback transaction
773
+  (0.0ms) begin transaction
774
+ ------------------------------------------------------------------------------
775
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
776
+ ------------------------------------------------------------------------------
777
+  (0.0ms) rollback transaction
778
+  (0.3ms) begin transaction
779
+ -------------------------------------------------------------------
780
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
781
+ -------------------------------------------------------------------
782
+  (0.1ms) rollback transaction
783
+  (0.0ms) begin transaction
784
+ --------------------------------------------------------------------------------------------
785
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
786
+ --------------------------------------------------------------------------------------------
787
+  (0.1ms) rollback transaction
788
+  (0.1ms) begin transaction
789
+ ----------------------------
790
+ CustomEmailsTest: test_truth
791
+ ----------------------------
792
+  (0.0ms) rollback transaction
793
+  (0.0ms) begin transaction
794
+ ----------------------------------------------------------------------------------
795
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
796
+ ----------------------------------------------------------------------------------
797
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
798
+  (0.0ms) SAVEPOINT active_record_1
799
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
800
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00]]
801
+  (0.0ms) RELEASE SAVEPOINT active_record_1
802
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
803
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
804
+  (0.0ms) SAVEPOINT active_record_1
805
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00]]
806
+  (0.0ms) RELEASE SAVEPOINT active_record_1
807
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
808
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
809
+  (0.1ms) rollback transaction
810
+  (0.0ms) begin transaction
811
+ --------------------------------------------------------------------------
812
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
813
+ --------------------------------------------------------------------------
814
+  (0.0ms) SAVEPOINT active_record_1
815
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
816
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00]]
817
+  (0.0ms) RELEASE SAVEPOINT active_record_1
818
+  (0.0ms) SAVEPOINT active_record_1
819
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:46:27 UTC +00:00]]
820
+  (0.0ms) RELEASE SAVEPOINT active_record_1
821
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
822
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
823
+
824
+ Sent mail to test@example.com (6.2ms)
825
+ Date: Mon, 21 Oct 2013 13:46:27 +0200
826
+ From: sender@example.org
827
+ To: test@example.com
828
+ Message-ID: <52651413e60b3_4b7365180088656@chocapic.mail>
829
+ Subject: Hello world!
830
+ Mime-Version: 1.0
831
+ Content-Type: text/plain;
832
+ charset=UTF-8
833
+ Content-Transfer-Encoding: 7bit
834
+
835
+ Good luck...
836
+  (0.1ms) rollback transaction
837
+  (0.0ms) begin transaction
838
+ ------------------------------------------------------------------------------
839
+ ModelsTest: test_models_unsing_has_custom_emails_ends_with_an_:emails_relation
840
+ ------------------------------------------------------------------------------
841
+  (0.0ms) rollback transaction
842
+  (0.3ms) begin transaction
843
+ -------------------------------------------------------------------
844
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
845
+ -------------------------------------------------------------------
846
+  (0.1ms) rollback transaction
847
+  (0.0ms) begin transaction
848
+ --------------------------------------------------------------------------------------------
849
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
850
+ --------------------------------------------------------------------------------------------
851
+  (0.1ms) rollback transaction
852
+  (0.0ms) begin transaction
853
+ ----------------------------
854
+ CustomEmailsTest: test_truth
855
+ ----------------------------
856
+  (0.0ms) rollback transaction
857
+  (0.0ms) begin transaction
858
+ ----------------------------------------------------------------------------------
859
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
860
+ ----------------------------------------------------------------------------------
861
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
862
+  (0.0ms) SAVEPOINT active_record_1
863
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
864
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00]]
865
+  (0.0ms) RELEASE SAVEPOINT active_record_1
866
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
867
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
868
+  (0.0ms) SAVEPOINT active_record_1
869
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00]]
870
+  (0.0ms) RELEASE SAVEPOINT active_record_1
871
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
872
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
873
+  (0.1ms) rollback transaction
874
+  (0.0ms) begin transaction
875
+ --------------------------------------------------------------------------
876
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
877
+ --------------------------------------------------------------------------
878
+  (0.0ms) SAVEPOINT active_record_1
879
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
880
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00]]
881
+  (0.0ms) RELEASE SAVEPOINT active_record_1
882
+  (0.0ms) SAVEPOINT active_record_1
883
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:55:39 UTC +00:00]]
884
+  (0.0ms) RELEASE SAVEPOINT active_record_1
885
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
886
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
887
+
888
+ Sent mail to test@example.com (6.3ms)
889
+ Date: Mon, 21 Oct 2013 13:55:39 +0200
890
+ From: sender@example.org
891
+ To: test@example.com
892
+ Message-ID: <5265163b4796_4c69d0a7f07175b@chocapic.mail>
893
+ Subject: Hello world!
894
+ Mime-Version: 1.0
895
+ Content-Type: text/plain;
896
+ charset=UTF-8
897
+ Content-Transfer-Encoding: 7bit
898
+
899
+ Good luck...
900
+  (0.1ms) rollback transaction
901
+  (0.0ms) begin transaction
902
+ -----------------------------------------------------------------------------------
903
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_by_kind_method
904
+ -----------------------------------------------------------------------------------
905
+  (0.0ms) rollback transaction
906
+  (0.0ms) begin transaction
907
+ -----------------------------------------------------------------------------
908
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
909
+ -----------------------------------------------------------------------------
910
+  (0.0ms) rollback transaction
911
+  (0.3ms) begin transaction
912
+ -------------------------------------------------------------------
913
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
914
+ -------------------------------------------------------------------
915
+  (0.1ms) rollback transaction
916
+  (0.4ms) begin transaction
917
+ --------------------------------------------------------------------------------------------
918
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
919
+ --------------------------------------------------------------------------------------------
920
+  (0.1ms) rollback transaction
921
+  (0.0ms) begin transaction
922
+ ----------------------------
923
+ CustomEmailsTest: test_truth
924
+ ----------------------------
925
+  (0.0ms) rollback transaction
926
+  (0.0ms) begin transaction
927
+ ----------------------------------------------------------------------------------
928
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
929
+ ----------------------------------------------------------------------------------
930
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
931
+  (0.0ms) SAVEPOINT active_record_1
932
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
933
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00]]
934
+  (0.0ms) RELEASE SAVEPOINT active_record_1
935
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
936
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
937
+  (0.0ms) SAVEPOINT active_record_1
938
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00]]
939
+  (0.0ms) RELEASE SAVEPOINT active_record_1
940
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
941
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
942
+  (0.1ms) rollback transaction
943
+  (0.0ms) begin transaction
944
+ --------------------------------------------------------------------------
945
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
946
+ --------------------------------------------------------------------------
947
+  (0.0ms) SAVEPOINT active_record_1
948
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
949
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00]]
950
+  (0.0ms) RELEASE SAVEPOINT active_record_1
951
+  (0.0ms) SAVEPOINT active_record_1
952
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 11:56:30 UTC +00:00]]
953
+  (0.0ms) RELEASE SAVEPOINT active_record_1
954
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
955
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
956
+
957
+ Sent mail to test@example.com (6.1ms)
958
+ Date: Mon, 21 Oct 2013 13:56:30 +0200
959
+ From: sender@example.org
960
+ To: test@example.com
961
+ Message-ID: <5265166ed0ca0_4c9598300055f6@chocapic.mail>
962
+ Subject: Hello world!
963
+ Mime-Version: 1.0
964
+ Content-Type: text/plain;
965
+ charset=UTF-8
966
+ Content-Transfer-Encoding: 7bit
967
+
968
+ Good luck...
969
+  (0.1ms) rollback transaction
970
+  (0.0ms) begin transaction
971
+ -----------------------------------------------------------------------------------
972
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_by_kind_method
973
+ -----------------------------------------------------------------------------------
974
+  (0.0ms) rollback transaction
975
+  (0.0ms) begin transaction
976
+ -----------------------------------------------------------------------------
977
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
978
+ -----------------------------------------------------------------------------
979
+  (0.0ms) rollback transaction
980
+  (0.0ms) begin transaction
981
+ -----------------------------------------------------------
982
+ ModelsTest: test_the_:emails_by_kind_method_returns_an_Hash
983
+ -----------------------------------------------------------
984
+  (0.1ms) rollback transaction
985
+  (0.3ms) begin transaction
986
+ -------------------------------------------------------------------
987
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
988
+ -------------------------------------------------------------------
989
+  (0.1ms) rollback transaction
990
+  (0.0ms) begin transaction
991
+ --------------------------------------------------------------------------------------------
992
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
993
+ --------------------------------------------------------------------------------------------
994
+  (0.1ms) rollback transaction
995
+  (0.0ms) begin transaction
996
+ ----------------------------
997
+ CustomEmailsTest: test_truth
998
+ ----------------------------
999
+  (0.0ms) rollback transaction
1000
+  (0.0ms) begin transaction
1001
+ ----------------------------------------------------------------------------------
1002
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1003
+ ----------------------------------------------------------------------------------
1004
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1005
+  (0.0ms) SAVEPOINT active_record_1
1006
+ CustomEmails::EmailKind Exists (0.2ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1007
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1008
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1009
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1010
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1011
+  (0.0ms) SAVEPOINT active_record_1
1012
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1013
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1014
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1015
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1016
+  (0.1ms) rollback transaction
1017
+  (0.0ms) begin transaction
1018
+ --------------------------------------------------------------------------
1019
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1020
+ --------------------------------------------------------------------------
1021
+  (0.0ms) SAVEPOINT active_record_1
1022
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1023
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1024
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1025
+  (0.0ms) SAVEPOINT active_record_1
1026
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1027
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1028
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1029
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1030
+
1031
+ Sent mail to test@example.com (6.1ms)
1032
+ Date: Mon, 21 Oct 2013 14:01:25 +0200
1033
+ From: sender@example.org
1034
+ To: test@example.com
1035
+ Message-ID: <5265179593c13_4cf7133bffc196a2@chocapic.mail>
1036
+ Subject: Hello world!
1037
+ Mime-Version: 1.0
1038
+ Content-Type: text/plain;
1039
+ charset=UTF-8
1040
+ Content-Transfer-Encoding: 7bit
1041
+
1042
+ Good luck...
1043
+  (0.1ms) rollback transaction
1044
+  (0.0ms) begin transaction
1045
+ -----------------------------------------------------------------------------------
1046
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1047
+ -----------------------------------------------------------------------------------
1048
+  (0.0ms) rollback transaction
1049
+  (0.0ms) begin transaction
1050
+ -----------------------------------------------------------------------------
1051
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1052
+ -----------------------------------------------------------------------------
1053
+  (0.0ms) rollback transaction
1054
+  (0.0ms) begin transaction
1055
+ -----------------------------------------------------------
1056
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1057
+ -----------------------------------------------------------
1058
+  (0.1ms) rollback transaction
1059
+  (0.0ms) begin transaction
1060
+ -------------------------------------------------------------------------------------
1061
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1062
+ -------------------------------------------------------------------------------------
1063
+  (0.0ms) SAVEPOINT active_record_1
1064
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1065
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1066
+  (0.0ms) SAVEPOINT active_record_1
1067
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1068
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1069
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1070
+  (0.0ms) SAVEPOINT active_record_1
1071
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1072
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1073
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1074
+  (0.0ms) SAVEPOINT active_record_1
1075
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1076
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1077
+  (0.0ms) SAVEPOINT active_record_1
1078
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:01:25 UTC +00:00]]
1079
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1080
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1081
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1082
+  (0.1ms) rollback transaction
1083
+  (0.3ms) begin transaction
1084
+ -------------------------------------------------------------------
1085
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1086
+ -------------------------------------------------------------------
1087
+  (0.1ms) rollback transaction
1088
+  (0.0ms) begin transaction
1089
+ --------------------------------------------------------------------------------------------
1090
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1091
+ --------------------------------------------------------------------------------------------
1092
+  (0.1ms) rollback transaction
1093
+  (0.0ms) begin transaction
1094
+ ----------------------------
1095
+ CustomEmailsTest: test_truth
1096
+ ----------------------------
1097
+  (0.0ms) rollback transaction
1098
+  (0.0ms) begin transaction
1099
+ ----------------------------------------------------------------------------------
1100
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1101
+ ----------------------------------------------------------------------------------
1102
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1103
+  (0.0ms) SAVEPOINT active_record_1
1104
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1105
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1106
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1107
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1108
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1109
+  (0.0ms) SAVEPOINT active_record_1
1110
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1111
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1112
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1113
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1114
+  (0.1ms) rollback transaction
1115
+  (0.0ms) begin transaction
1116
+ --------------------------------------------------------------------------
1117
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1118
+ --------------------------------------------------------------------------
1119
+  (0.0ms) SAVEPOINT active_record_1
1120
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1121
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1122
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1123
+  (0.0ms) SAVEPOINT active_record_1
1124
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1125
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1126
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1127
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1128
+
1129
+ Sent mail to test@example.com (9.2ms)
1130
+ Date: Mon, 21 Oct 2013 14:02:00 +0200
1131
+ From: sender@example.org
1132
+ To: test@example.com
1133
+ Message-ID: <526517b8110a9_4d219fcff475355@chocapic.mail>
1134
+ Subject: Hello world!
1135
+ Mime-Version: 1.0
1136
+ Content-Type: text/plain;
1137
+ charset=UTF-8
1138
+ Content-Transfer-Encoding: 7bit
1139
+
1140
+ Good luck...
1141
+  (0.1ms) rollback transaction
1142
+  (0.0ms) begin transaction
1143
+ -----------------------------------------------------------------------------------
1144
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1145
+ -----------------------------------------------------------------------------------
1146
+  (0.0ms) rollback transaction
1147
+  (0.0ms) begin transaction
1148
+ -----------------------------------------------------------------------------
1149
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1150
+ -----------------------------------------------------------------------------
1151
+  (0.0ms) rollback transaction
1152
+  (0.0ms) begin transaction
1153
+ -----------------------------------------------------------
1154
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1155
+ -----------------------------------------------------------
1156
+  (0.1ms) rollback transaction
1157
+  (0.0ms) begin transaction
1158
+ -------------------------------------------------------------------------------------
1159
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1160
+ -------------------------------------------------------------------------------------
1161
+  (0.0ms) SAVEPOINT active_record_1
1162
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1163
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1164
+  (0.0ms) SAVEPOINT active_record_1
1165
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1166
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1167
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1168
+  (0.0ms) SAVEPOINT active_record_1
1169
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1170
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1171
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1172
+  (0.0ms) SAVEPOINT active_record_1
1173
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1174
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1175
+  (0.0ms) SAVEPOINT active_record_1
1176
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:02:00 UTC +00:00]]
1177
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1178
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1179
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1180
+  (0.3ms) rollback transaction
1181
+  (0.4ms) begin transaction
1182
+ -------------------------------------------------------------------
1183
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1184
+ -------------------------------------------------------------------
1185
+  (0.1ms) rollback transaction
1186
+  (0.0ms) begin transaction
1187
+ --------------------------------------------------------------------------------------------
1188
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1189
+ --------------------------------------------------------------------------------------------
1190
+  (0.1ms) rollback transaction
1191
+  (0.0ms) begin transaction
1192
+ ----------------------------
1193
+ CustomEmailsTest: test_truth
1194
+ ----------------------------
1195
+  (0.0ms) rollback transaction
1196
+  (0.0ms) begin transaction
1197
+ ----------------------------------------------------------------------------------
1198
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1199
+ ----------------------------------------------------------------------------------
1200
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1201
+  (0.0ms) SAVEPOINT active_record_1
1202
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1203
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1204
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1205
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1206
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1207
+  (0.0ms) SAVEPOINT active_record_1
1208
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1209
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1210
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1211
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1212
+  (0.1ms) rollback transaction
1213
+  (0.0ms) begin transaction
1214
+ --------------------------------------------------------------------------
1215
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1216
+ --------------------------------------------------------------------------
1217
+  (0.0ms) SAVEPOINT active_record_1
1218
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1219
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1220
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1221
+  (0.0ms) SAVEPOINT active_record_1
1222
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1223
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1224
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1225
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1226
+
1227
+ Sent mail to test@example.com (5.8ms)
1228
+ Date: Mon, 21 Oct 2013 14:08:44 +0200
1229
+ From: sender@example.org
1230
+ To: test@example.com
1231
+ Message-ID: <5265194c791dc_4dc312e080039f4@chocapic.mail>
1232
+ Subject: Hello world!
1233
+ Mime-Version: 1.0
1234
+ Content-Type: text/plain;
1235
+ charset=UTF-8
1236
+ Content-Transfer-Encoding: 7bit
1237
+
1238
+ Good luck...
1239
+  (0.1ms) rollback transaction
1240
+  (0.0ms) begin transaction
1241
+ -----------------------------------------------------------------------------------
1242
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1243
+ -----------------------------------------------------------------------------------
1244
+  (0.0ms) rollback transaction
1245
+  (0.0ms) begin transaction
1246
+ -----------------------------------------------------------------------------
1247
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1248
+ -----------------------------------------------------------------------------
1249
+  (0.0ms) rollback transaction
1250
+  (0.0ms) begin transaction
1251
+ -----------------------------------------------------------
1252
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1253
+ -----------------------------------------------------------
1254
+  (0.1ms) rollback transaction
1255
+  (0.0ms) begin transaction
1256
+ -------------------------------------------------------------------------------------
1257
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1258
+ -------------------------------------------------------------------------------------
1259
+  (0.0ms) SAVEPOINT active_record_1
1260
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1261
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1262
+  (0.0ms) SAVEPOINT active_record_1
1263
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1264
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1265
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1266
+  (0.0ms) SAVEPOINT active_record_1
1267
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1268
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1269
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1270
+  (0.0ms) SAVEPOINT active_record_1
1271
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1272
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1273
+  (0.0ms) SAVEPOINT active_record_1
1274
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:08:44 UTC +00:00]]
1275
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1276
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1277
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1278
+  (0.1ms) rollback transaction
1279
+  (0.3ms) begin transaction
1280
+ -------------------------------------------------------------------
1281
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1282
+ -------------------------------------------------------------------
1283
+  (0.1ms) rollback transaction
1284
+  (0.0ms) begin transaction
1285
+ --------------------------------------------------------------------------------------------
1286
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1287
+ --------------------------------------------------------------------------------------------
1288
+  (0.1ms) rollback transaction
1289
+  (0.0ms) begin transaction
1290
+ ----------------------------
1291
+ CustomEmailsTest: test_truth
1292
+ ----------------------------
1293
+  (0.0ms) rollback transaction
1294
+  (0.0ms) begin transaction
1295
+ ----------------------------------------------------------------------------------
1296
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1297
+ ----------------------------------------------------------------------------------
1298
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1299
+  (0.0ms) SAVEPOINT active_record_1
1300
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1301
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1302
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1303
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1304
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1305
+  (0.0ms) SAVEPOINT active_record_1
1306
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1307
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1308
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1309
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1310
+  (0.1ms) rollback transaction
1311
+  (0.0ms) begin transaction
1312
+ --------------------------------------------------------------------------
1313
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1314
+ --------------------------------------------------------------------------
1315
+  (0.0ms) SAVEPOINT active_record_1
1316
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1317
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1318
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1319
+  (0.0ms) SAVEPOINT active_record_1
1320
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1321
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1322
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1323
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1324
+
1325
+ Sent mail to test@example.com (5.8ms)
1326
+ Date: Mon, 21 Oct 2013 14:11:05 +0200
1327
+ From: sender@example.org
1328
+ To: test@example.com
1329
+ Message-ID: <526519d9b0d08_4e08b9f0003652@chocapic.mail>
1330
+ Subject: Hello world!
1331
+ Mime-Version: 1.0
1332
+ Content-Type: text/plain;
1333
+ charset=UTF-8
1334
+ Content-Transfer-Encoding: 7bit
1335
+
1336
+ Good luck...
1337
+  (0.1ms) rollback transaction
1338
+  (0.0ms) begin transaction
1339
+ -----------------------------------------------------------------------------------
1340
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1341
+ -----------------------------------------------------------------------------------
1342
+  (0.0ms) rollback transaction
1343
+  (0.0ms) begin transaction
1344
+ -----------------------------------------------------------------------------
1345
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1346
+ -----------------------------------------------------------------------------
1347
+  (0.0ms) rollback transaction
1348
+  (0.0ms) begin transaction
1349
+ -----------------------------------------------------------
1350
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1351
+ -----------------------------------------------------------
1352
+  (0.1ms) rollback transaction
1353
+  (0.0ms) begin transaction
1354
+ -------------------------------------------------------------------------------------
1355
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1356
+ -------------------------------------------------------------------------------------
1357
+  (0.0ms) SAVEPOINT active_record_1
1358
+ SQL (0.2ms) INSERT INTO "examples" DEFAULT VALUES
1359
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1360
+  (0.0ms) SAVEPOINT active_record_1
1361
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1362
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1363
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1364
+  (0.0ms) SAVEPOINT active_record_1
1365
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1366
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1367
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1368
+  (0.0ms) SAVEPOINT active_record_1
1369
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1370
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1371
+  (0.0ms) SAVEPOINT active_record_1
1372
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:11:05 UTC +00:00]]
1373
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1374
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1375
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1376
+  (0.1ms) rollback transaction
1377
+  (0.3ms) begin transaction
1378
+ -------------------------------------------------------------------
1379
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1380
+ -------------------------------------------------------------------
1381
+  (0.1ms) rollback transaction
1382
+  (0.0ms) begin transaction
1383
+ --------------------------------------------------------------------------------------------
1384
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1385
+ --------------------------------------------------------------------------------------------
1386
+  (0.1ms) rollback transaction
1387
+  (0.1ms) begin transaction
1388
+ ----------------------------
1389
+ CustomEmailsTest: test_truth
1390
+ ----------------------------
1391
+  (0.0ms) rollback transaction
1392
+  (0.0ms) begin transaction
1393
+ ----------------------------------------------------------------------------------
1394
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1395
+ ----------------------------------------------------------------------------------
1396
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1397
+  (0.0ms) SAVEPOINT active_record_1
1398
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1399
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1400
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1401
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1402
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1403
+  (0.0ms) SAVEPOINT active_record_1
1404
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1405
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1406
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1407
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1408
+  (0.1ms) rollback transaction
1409
+  (0.0ms) begin transaction
1410
+ --------------------------------------------------------------------------
1411
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1412
+ --------------------------------------------------------------------------
1413
+  (0.0ms) SAVEPOINT active_record_1
1414
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1415
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1416
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1417
+  (0.0ms) SAVEPOINT active_record_1
1418
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1419
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1420
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1421
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1422
+
1423
+ Sent mail to test@example.com (6.2ms)
1424
+ Date: Mon, 21 Oct 2013 14:14:52 +0200
1425
+ From: sender@example.org
1426
+ To: test@example.com
1427
+ Message-ID: <52651abcaeaa4_4e7610b47fc87f9@chocapic.mail>
1428
+ Subject: Hello world!
1429
+ Mime-Version: 1.0
1430
+ Content-Type: text/plain;
1431
+ charset=UTF-8
1432
+ Content-Transfer-Encoding: 7bit
1433
+
1434
+ Good luck...
1435
+  (0.1ms) rollback transaction
1436
+  (0.0ms) begin transaction
1437
+ -----------------------------------------------------------------------------------
1438
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1439
+ -----------------------------------------------------------------------------------
1440
+  (0.0ms) rollback transaction
1441
+  (0.0ms) begin transaction
1442
+ -----------------------------------------------------------------------------
1443
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1444
+ -----------------------------------------------------------------------------
1445
+  (0.0ms) rollback transaction
1446
+  (0.0ms) begin transaction
1447
+ -----------------------------------------------------------
1448
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1449
+ -----------------------------------------------------------
1450
+  (0.0ms) rollback transaction
1451
+  (0.0ms) begin transaction
1452
+ -------------------------------------------------------------------------------------
1453
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1454
+ -------------------------------------------------------------------------------------
1455
+  (0.0ms) SAVEPOINT active_record_1
1456
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1457
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1458
+  (0.0ms) SAVEPOINT active_record_1
1459
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1460
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1461
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1462
+  (0.0ms) SAVEPOINT active_record_1
1463
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1464
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1465
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466
+  (0.1ms) SAVEPOINT active_record_1
1467
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1468
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1469
+  (0.0ms) SAVEPOINT active_record_1
1470
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:14:52 UTC +00:00]]
1471
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1472
+  (0.1ms) rollback transaction
1473
+  (0.3ms) begin transaction
1474
+ -------------------------------------------------------------------
1475
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1476
+ -------------------------------------------------------------------
1477
+  (0.1ms) rollback transaction
1478
+  (0.0ms) begin transaction
1479
+ --------------------------------------------------------------------------------------------
1480
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1481
+ --------------------------------------------------------------------------------------------
1482
+  (0.1ms) rollback transaction
1483
+  (0.0ms) begin transaction
1484
+ ----------------------------
1485
+ CustomEmailsTest: test_truth
1486
+ ----------------------------
1487
+  (0.0ms) rollback transaction
1488
+  (0.0ms) begin transaction
1489
+ ----------------------------------------------------------------------------------
1490
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1491
+ ----------------------------------------------------------------------------------
1492
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1493
+  (0.0ms) SAVEPOINT active_record_1
1494
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1495
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1496
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1497
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1498
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1499
+  (0.0ms) SAVEPOINT active_record_1
1500
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1501
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1502
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1503
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1504
+  (0.1ms) rollback transaction
1505
+  (0.0ms) begin transaction
1506
+ --------------------------------------------------------------------------
1507
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1508
+ --------------------------------------------------------------------------
1509
+  (0.0ms) SAVEPOINT active_record_1
1510
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1511
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1512
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1513
+  (0.0ms) SAVEPOINT active_record_1
1514
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1515
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1516
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1517
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1518
+
1519
+ Sent mail to test@example.com (5.9ms)
1520
+ Date: Mon, 21 Oct 2013 14:15:16 +0200
1521
+ From: sender@example.org
1522
+ To: test@example.com
1523
+ Message-ID: <52651ad46e1af_4e9eed300069727@chocapic.mail>
1524
+ Subject: Hello world!
1525
+ Mime-Version: 1.0
1526
+ Content-Type: text/plain;
1527
+ charset=UTF-8
1528
+ Content-Transfer-Encoding: 7bit
1529
+
1530
+ Good luck...
1531
+  (0.1ms) rollback transaction
1532
+  (0.0ms) begin transaction
1533
+ -----------------------------------------------------------------------------------
1534
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1535
+ -----------------------------------------------------------------------------------
1536
+  (0.0ms) rollback transaction
1537
+  (0.0ms) begin transaction
1538
+ -----------------------------------------------------------------------------
1539
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1540
+ -----------------------------------------------------------------------------
1541
+  (0.0ms) rollback transaction
1542
+  (0.0ms) begin transaction
1543
+ -----------------------------------------------------------
1544
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1545
+ -----------------------------------------------------------
1546
+  (0.1ms) rollback transaction
1547
+  (0.0ms) begin transaction
1548
+ -------------------------------------------------------------------------------------
1549
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1550
+ -------------------------------------------------------------------------------------
1551
+  (0.0ms) SAVEPOINT active_record_1
1552
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1553
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1554
+  (0.0ms) SAVEPOINT active_record_1
1555
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1556
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1557
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1558
+  (0.0ms) SAVEPOINT active_record_1
1559
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1560
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1561
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1562
+  (0.0ms) SAVEPOINT active_record_1
1563
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1564
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1565
+  (0.0ms) SAVEPOINT active_record_1
1566
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:15:16 UTC +00:00]]
1567
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1568
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1569
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1570
+  (0.1ms) rollback transaction
1571
+  (0.3ms) begin transaction
1572
+ -------------------------------------------------------------------
1573
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1574
+ -------------------------------------------------------------------
1575
+  (0.1ms) rollback transaction
1576
+  (0.0ms) begin transaction
1577
+ --------------------------------------------------------------------------------------------
1578
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1579
+ --------------------------------------------------------------------------------------------
1580
+  (0.1ms) rollback transaction
1581
+  (0.0ms) begin transaction
1582
+ ----------------------------
1583
+ CustomEmailsTest: test_truth
1584
+ ----------------------------
1585
+  (0.0ms) rollback transaction
1586
+  (0.0ms) begin transaction
1587
+ ----------------------------------------------------------------------------------
1588
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1589
+ ----------------------------------------------------------------------------------
1590
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1591
+  (0.0ms) SAVEPOINT active_record_1
1592
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1593
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1594
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1595
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1596
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1597
+  (0.0ms) SAVEPOINT active_record_1
1598
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1599
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1600
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1601
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1602
+  (0.1ms) rollback transaction
1603
+  (0.0ms) begin transaction
1604
+ --------------------------------------------------------------------------
1605
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1606
+ --------------------------------------------------------------------------
1607
+  (0.0ms) SAVEPOINT active_record_1
1608
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1609
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1610
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1611
+  (0.0ms) SAVEPOINT active_record_1
1612
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1613
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1614
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1615
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1616
+
1617
+ Sent mail to test@example.com (6.0ms)
1618
+ Date: Mon, 21 Oct 2013 14:16:56 +0200
1619
+ From: sender@example.org
1620
+ To: test@example.com
1621
+ Message-ID: <52651b38d1fff_4ed311a9ff4308a5@chocapic.mail>
1622
+ Subject: Hello world!
1623
+ Mime-Version: 1.0
1624
+ Content-Type: text/plain;
1625
+ charset=UTF-8
1626
+ Content-Transfer-Encoding: 7bit
1627
+
1628
+ Good luck...
1629
+  (0.1ms) rollback transaction
1630
+  (0.0ms) begin transaction
1631
+ -----------------------------------------------------------------------------------
1632
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1633
+ -----------------------------------------------------------------------------------
1634
+  (0.0ms) rollback transaction
1635
+  (0.0ms) begin transaction
1636
+ -----------------------------------------------------------------------------
1637
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1638
+ -----------------------------------------------------------------------------
1639
+  (0.0ms) rollback transaction
1640
+  (0.0ms) begin transaction
1641
+ --------------------------------------------------------------------------------------------
1642
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
1643
+ --------------------------------------------------------------------------------------------
1644
+  (0.0ms) SAVEPOINT active_record_1
1645
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1646
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1647
+  (0.0ms) SAVEPOINT active_record_1
1648
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1649
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1650
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1651
+  (0.0ms) SAVEPOINT active_record_1
1652
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1653
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1654
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1655
+  (0.1ms) SAVEPOINT active_record_1
1656
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1657
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1658
+  (0.0ms) SAVEPOINT active_record_1
1659
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1660
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1661
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
1662
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
1663
+  (0.1ms) rollback transaction
1664
+  (0.0ms) begin transaction
1665
+ -----------------------------------------------------------
1666
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1667
+ -----------------------------------------------------------
1668
+  (0.1ms) rollback transaction
1669
+  (0.0ms) begin transaction
1670
+ -------------------------------------------------------------------------------------
1671
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1672
+ -------------------------------------------------------------------------------------
1673
+  (0.0ms) SAVEPOINT active_record_1
1674
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1675
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1676
+  (0.0ms) SAVEPOINT active_record_1
1677
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1678
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1679
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1680
+  (0.0ms) SAVEPOINT active_record_1
1681
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1682
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1683
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1684
+  (0.0ms) SAVEPOINT active_record_1
1685
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1686
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1687
+  (0.0ms) SAVEPOINT active_record_1
1688
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:16:56 UTC +00:00]]
1689
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1690
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1691
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1692
+  (0.1ms) rollback transaction
1693
+  (0.3ms) begin transaction
1694
+ -------------------------------------------------------------------
1695
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1696
+ -------------------------------------------------------------------
1697
+  (0.1ms) rollback transaction
1698
+  (0.0ms) begin transaction
1699
+ --------------------------------------------------------------------------------------------
1700
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1701
+ --------------------------------------------------------------------------------------------
1702
+  (0.1ms) rollback transaction
1703
+  (0.0ms) begin transaction
1704
+ ----------------------------
1705
+ CustomEmailsTest: test_truth
1706
+ ----------------------------
1707
+  (0.0ms) rollback transaction
1708
+  (0.0ms) begin transaction
1709
+ ----------------------------------------------------------------------------------
1710
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1711
+ ----------------------------------------------------------------------------------
1712
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1713
+  (0.0ms) SAVEPOINT active_record_1
1714
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1715
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1716
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1717
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1718
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1719
+  (0.0ms) SAVEPOINT active_record_1
1720
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1721
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1722
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1723
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1724
+  (0.1ms) rollback transaction
1725
+  (0.0ms) begin transaction
1726
+ --------------------------------------------------------------------------
1727
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1728
+ --------------------------------------------------------------------------
1729
+  (0.0ms) SAVEPOINT active_record_1
1730
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1731
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1732
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1733
+  (0.0ms) SAVEPOINT active_record_1
1734
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1735
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1736
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1737
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1738
+
1739
+ Sent mail to test@example.com (5.8ms)
1740
+ Date: Mon, 21 Oct 2013 14:17:07 +0200
1741
+ From: sender@example.org
1742
+ To: test@example.com
1743
+ Message-ID: <52651b43dc3ad_4ef9f14000505c4@chocapic.mail>
1744
+ Subject: Hello world!
1745
+ Mime-Version: 1.0
1746
+ Content-Type: text/plain;
1747
+ charset=UTF-8
1748
+ Content-Transfer-Encoding: 7bit
1749
+
1750
+ Good luck...
1751
+  (0.1ms) rollback transaction
1752
+  (0.0ms) begin transaction
1753
+ -----------------------------------------------------------------------------------
1754
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1755
+ -----------------------------------------------------------------------------------
1756
+  (0.0ms) rollback transaction
1757
+  (0.0ms) begin transaction
1758
+ -----------------------------------------------------------------------------
1759
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1760
+ -----------------------------------------------------------------------------
1761
+  (0.0ms) rollback transaction
1762
+  (0.0ms) begin transaction
1763
+ --------------------------------------------------------------------------------------------
1764
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
1765
+ --------------------------------------------------------------------------------------------
1766
+  (0.0ms) SAVEPOINT active_record_1
1767
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1768
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1769
+  (0.0ms) SAVEPOINT active_record_1
1770
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1771
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1772
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1773
+  (0.0ms) SAVEPOINT active_record_1
1774
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1775
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1776
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1777
+  (0.1ms) SAVEPOINT active_record_1
1778
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1779
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1780
+  (0.0ms) SAVEPOINT active_record_1
1781
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1782
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1783
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1784
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1785
+  (0.1ms) rollback transaction
1786
+  (0.0ms) begin transaction
1787
+ -----------------------------------------------------------
1788
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1789
+ -----------------------------------------------------------
1790
+  (0.1ms) rollback transaction
1791
+  (0.0ms) begin transaction
1792
+ -------------------------------------------------------------------------------------
1793
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1794
+ -------------------------------------------------------------------------------------
1795
+  (0.0ms) SAVEPOINT active_record_1
1796
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1797
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1798
+  (0.0ms) SAVEPOINT active_record_1
1799
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1800
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1801
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1802
+  (0.0ms) SAVEPOINT active_record_1
1803
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1804
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1805
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1806
+  (0.0ms) SAVEPOINT active_record_1
1807
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1808
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1809
+  (0.0ms) SAVEPOINT active_record_1
1810
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:17:07 UTC +00:00]]
1811
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1812
+ CustomEmails::Email Load (0.0ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1813
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1814
+  (0.1ms) rollback transaction
1815
+  (0.3ms) begin transaction
1816
+ -------------------------------------------------------------------
1817
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1818
+ -------------------------------------------------------------------
1819
+  (0.1ms) rollback transaction
1820
+  (0.0ms) begin transaction
1821
+ --------------------------------------------------------------------------------------------
1822
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1823
+ --------------------------------------------------------------------------------------------
1824
+  (0.1ms) rollback transaction
1825
+  (0.0ms) begin transaction
1826
+ ----------------------------
1827
+ CustomEmailsTest: test_truth
1828
+ ----------------------------
1829
+  (0.0ms) rollback transaction
1830
+  (0.0ms) begin transaction
1831
+ ----------------------------------------------------------------------------------
1832
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1833
+ ----------------------------------------------------------------------------------
1834
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1835
+  (0.0ms) SAVEPOINT active_record_1
1836
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1837
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1838
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1839
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1840
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1841
+  (0.0ms) SAVEPOINT active_record_1
1842
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1843
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1844
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1845
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1846
+  (0.1ms) rollback transaction
1847
+  (0.0ms) begin transaction
1848
+ --------------------------------------------------------------------------
1849
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1850
+ --------------------------------------------------------------------------
1851
+  (0.0ms) SAVEPOINT active_record_1
1852
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1853
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1854
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1855
+  (0.0ms) SAVEPOINT active_record_1
1856
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1857
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1858
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1859
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1860
+
1861
+ Sent mail to test@example.com (6.1ms)
1862
+ Date: Mon, 21 Oct 2013 14:17:15 +0200
1863
+ From: sender@example.org
1864
+ To: test@example.com
1865
+ Message-ID: <52651b4bb1348_4f1c4597f09732a@chocapic.mail>
1866
+ Subject: Hello world!
1867
+ Mime-Version: 1.0
1868
+ Content-Type: text/plain;
1869
+ charset=UTF-8
1870
+ Content-Transfer-Encoding: 7bit
1871
+
1872
+ Good luck...
1873
+  (0.1ms) rollback transaction
1874
+  (0.0ms) begin transaction
1875
+ -----------------------------------------------------------------------------------
1876
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1877
+ -----------------------------------------------------------------------------------
1878
+  (0.1ms) rollback transaction
1879
+  (0.0ms) begin transaction
1880
+ -----------------------------------------------------------------------------
1881
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
1882
+ -----------------------------------------------------------------------------
1883
+  (0.0ms) rollback transaction
1884
+  (0.0ms) begin transaction
1885
+ --------------------------------------------------------------------------------------------
1886
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
1887
+ --------------------------------------------------------------------------------------------
1888
+  (0.0ms) SAVEPOINT active_record_1
1889
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1890
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1891
+  (0.0ms) SAVEPOINT active_record_1
1892
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1893
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1894
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1895
+  (0.0ms) SAVEPOINT active_record_1
1896
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1897
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1898
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1899
+  (0.1ms) SAVEPOINT active_record_1
1900
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1901
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1902
+  (0.0ms) SAVEPOINT active_record_1
1903
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1904
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1905
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
1906
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
1907
+  (0.1ms) rollback transaction
1908
+  (0.0ms) begin transaction
1909
+ -----------------------------------------------------------
1910
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
1911
+ -----------------------------------------------------------
1912
+  (0.1ms) rollback transaction
1913
+  (0.0ms) begin transaction
1914
+ -------------------------------------------------------------------------------------
1915
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
1916
+ -------------------------------------------------------------------------------------
1917
+  (0.0ms) SAVEPOINT active_record_1
1918
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
1919
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1920
+  (0.0ms) SAVEPOINT active_record_1
1921
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1922
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1923
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1924
+  (0.0ms) SAVEPOINT active_record_1
1925
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
1926
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1927
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1928
+  (0.0ms) SAVEPOINT active_record_1
1929
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1930
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1931
+  (0.0ms) SAVEPOINT active_record_1
1932
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:17:15 UTC +00:00]]
1933
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1934
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
1935
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
1936
+  (0.1ms) rollback transaction
1937
+  (0.3ms) begin transaction
1938
+ -------------------------------------------------------------------
1939
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
1940
+ -------------------------------------------------------------------
1941
+  (0.1ms) rollback transaction
1942
+  (0.0ms) begin transaction
1943
+ --------------------------------------------------------------------------------------------
1944
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
1945
+ --------------------------------------------------------------------------------------------
1946
+  (0.1ms) rollback transaction
1947
+  (0.0ms) begin transaction
1948
+ ----------------------------
1949
+ CustomEmailsTest: test_truth
1950
+ ----------------------------
1951
+  (0.0ms) rollback transaction
1952
+  (0.0ms) begin transaction
1953
+ ----------------------------------------------------------------------------------
1954
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
1955
+ ----------------------------------------------------------------------------------
1956
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1957
+  (0.0ms) SAVEPOINT active_record_1
1958
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1959
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
1960
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1961
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1962
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1963
+  (0.0ms) SAVEPOINT active_record_1
1964
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
1965
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1966
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1967
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1968
+  (0.1ms) rollback transaction
1969
+  (0.0ms) begin transaction
1970
+ --------------------------------------------------------------------------
1971
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
1972
+ --------------------------------------------------------------------------
1973
+  (0.0ms) SAVEPOINT active_record_1
1974
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1975
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
1976
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1977
+  (0.0ms) SAVEPOINT active_record_1
1978
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
1979
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1980
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
1981
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
1982
+
1983
+ Sent mail to test@example.com (5.8ms)
1984
+ Date: Mon, 21 Oct 2013 14:24:16 +0200
1985
+ From: sender@example.org
1986
+ To: test@example.com
1987
+ Message-ID: <52651cf04cf36_50baba97f8498e6@chocapic.mail>
1988
+ Subject: Hello world!
1989
+ Mime-Version: 1.0
1990
+ Content-Type: text/plain;
1991
+ charset=UTF-8
1992
+ Content-Transfer-Encoding: 7bit
1993
+
1994
+ Good luck...
1995
+  (0.1ms) rollback transaction
1996
+  (0.0ms) begin transaction
1997
+ -----------------------------------------------------------------------------------
1998
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
1999
+ -----------------------------------------------------------------------------------
2000
+  (0.0ms) rollback transaction
2001
+  (0.0ms) begin transaction
2002
+ -----------------------------------------------------------------------------
2003
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2004
+ -----------------------------------------------------------------------------
2005
+  (0.0ms) rollback transaction
2006
+  (0.0ms) begin transaction
2007
+ --------------------------------------------------------------------------------------------
2008
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2009
+ --------------------------------------------------------------------------------------------
2010
+  (0.0ms) SAVEPOINT active_record_1
2011
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2012
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2013
+  (0.0ms) SAVEPOINT active_record_1
2014
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2015
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2016
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2017
+  (0.0ms) SAVEPOINT active_record_1
2018
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2019
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2020
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2021
+  (0.1ms) SAVEPOINT active_record_1
2022
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2023
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2024
+  (0.0ms) SAVEPOINT active_record_1
2025
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2026
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2027
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2028
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2029
+  (0.1ms) rollback transaction
2030
+  (0.0ms) begin transaction
2031
+ -----------------------------------------------------------
2032
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2033
+ -----------------------------------------------------------
2034
+  (0.1ms) rollback transaction
2035
+  (0.0ms) begin transaction
2036
+ -------------------------------------------------------------------------------------
2037
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2038
+ -------------------------------------------------------------------------------------
2039
+  (0.0ms) SAVEPOINT active_record_1
2040
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2041
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2042
+  (0.0ms) SAVEPOINT active_record_1
2043
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2044
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2045
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2046
+  (0.0ms) SAVEPOINT active_record_1
2047
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2048
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2049
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2050
+  (0.0ms) SAVEPOINT active_record_1
2051
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2052
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2053
+  (0.0ms) SAVEPOINT active_record_1
2054
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:24:16 UTC +00:00]]
2055
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2056
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2057
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2058
+  (0.1ms) rollback transaction
2059
+  (0.3ms) begin transaction
2060
+ -------------------------------------------------------------------
2061
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2062
+ -------------------------------------------------------------------
2063
+  (0.1ms) rollback transaction
2064
+  (0.0ms) begin transaction
2065
+ --------------------------------------------------------------------------------------------
2066
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2067
+ --------------------------------------------------------------------------------------------
2068
+  (0.1ms) rollback transaction
2069
+  (0.0ms) begin transaction
2070
+ ----------------------------
2071
+ CustomEmailsTest: test_truth
2072
+ ----------------------------
2073
+  (0.0ms) rollback transaction
2074
+  (0.0ms) begin transaction
2075
+ ----------------------------------------------------------------------------------
2076
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2077
+ ----------------------------------------------------------------------------------
2078
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2079
+  (0.0ms) SAVEPOINT active_record_1
2080
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2081
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2082
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2083
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2084
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2085
+  (0.0ms) SAVEPOINT active_record_1
2086
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2087
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2088
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2089
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2090
+  (0.1ms) rollback transaction
2091
+  (0.0ms) begin transaction
2092
+ --------------------------------------------------------------------------
2093
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2094
+ --------------------------------------------------------------------------
2095
+  (0.1ms) SAVEPOINT active_record_1
2096
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2097
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2098
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2099
+  (0.0ms) SAVEPOINT active_record_1
2100
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2101
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2102
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2103
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2104
+  (0.1ms) rollback transaction
2105
+  (0.0ms) begin transaction
2106
+ -----------------------------------------------------------------------------------
2107
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2108
+ -----------------------------------------------------------------------------------
2109
+  (0.0ms) rollback transaction
2110
+  (0.0ms) begin transaction
2111
+ -----------------------------------------------------------------------------
2112
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2113
+ -----------------------------------------------------------------------------
2114
+  (0.0ms) rollback transaction
2115
+  (0.0ms) begin transaction
2116
+ --------------------------------------------------------------------------------------------
2117
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2118
+ --------------------------------------------------------------------------------------------
2119
+  (0.0ms) SAVEPOINT active_record_1
2120
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2121
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2122
+  (0.0ms) SAVEPOINT active_record_1
2123
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2124
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2125
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2126
+  (0.0ms) SAVEPOINT active_record_1
2127
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2128
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2129
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2130
+  (0.1ms) SAVEPOINT active_record_1
2131
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2132
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2133
+  (0.0ms) SAVEPOINT active_record_1
2134
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2135
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2136
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2137
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2138
+  (0.1ms) rollback transaction
2139
+  (0.0ms) begin transaction
2140
+ -----------------------------------------------------------
2141
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2142
+ -----------------------------------------------------------
2143
+  (0.0ms) rollback transaction
2144
+  (0.0ms) begin transaction
2145
+ -------------------------------------------------------------------------------------
2146
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2147
+ -------------------------------------------------------------------------------------
2148
+  (0.0ms) SAVEPOINT active_record_1
2149
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2150
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2151
+  (0.0ms) SAVEPOINT active_record_1
2152
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2153
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2154
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2155
+  (0.0ms) SAVEPOINT active_record_1
2156
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2157
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2158
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2159
+  (0.0ms) SAVEPOINT active_record_1
2160
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2161
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2162
+  (0.0ms) SAVEPOINT active_record_1
2163
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:45:39 UTC +00:00]]
2164
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2165
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2166
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2167
+  (0.1ms) rollback transaction
2168
+  (0.3ms) begin transaction
2169
+ -------------------------------------------------------------------
2170
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2171
+ -------------------------------------------------------------------
2172
+  (0.1ms) rollback transaction
2173
+  (0.0ms) begin transaction
2174
+ --------------------------------------------------------------------------------------------
2175
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2176
+ --------------------------------------------------------------------------------------------
2177
+  (0.1ms) rollback transaction
2178
+  (0.0ms) begin transaction
2179
+ ----------------------------
2180
+ CustomEmailsTest: test_truth
2181
+ ----------------------------
2182
+  (0.0ms) rollback transaction
2183
+  (0.0ms) begin transaction
2184
+ ----------------------------------------------------------------------------------
2185
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2186
+ ----------------------------------------------------------------------------------
2187
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2188
+  (0.0ms) SAVEPOINT active_record_1
2189
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2190
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2191
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2192
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2193
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2194
+  (0.0ms) SAVEPOINT active_record_1
2195
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2196
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2197
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2198
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2199
+  (0.1ms) rollback transaction
2200
+  (0.0ms) begin transaction
2201
+ --------------------------------------------------------------------------
2202
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2203
+ --------------------------------------------------------------------------
2204
+  (0.0ms) SAVEPOINT active_record_1
2205
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2206
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2207
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2208
+  (0.0ms) SAVEPOINT active_record_1
2209
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2210
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2211
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2212
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2213
+  (0.1ms) rollback transaction
2214
+  (0.0ms) begin transaction
2215
+ -----------------------------------------------------------------------------------
2216
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2217
+ -----------------------------------------------------------------------------------
2218
+  (0.0ms) rollback transaction
2219
+  (0.0ms) begin transaction
2220
+ -----------------------------------------------------------------------------
2221
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2222
+ -----------------------------------------------------------------------------
2223
+  (0.0ms) rollback transaction
2224
+  (0.0ms) begin transaction
2225
+ --------------------------------------------------------------------------------------------
2226
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2227
+ --------------------------------------------------------------------------------------------
2228
+  (0.0ms) SAVEPOINT active_record_1
2229
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2230
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2231
+  (0.0ms) SAVEPOINT active_record_1
2232
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2233
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2234
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2235
+  (0.0ms) SAVEPOINT active_record_1
2236
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2237
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2238
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2239
+  (0.1ms) SAVEPOINT active_record_1
2240
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2241
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2242
+  (0.0ms) SAVEPOINT active_record_1
2243
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2244
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2245
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2246
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2247
+  (0.1ms) rollback transaction
2248
+  (0.0ms) begin transaction
2249
+ -----------------------------------------------------------
2250
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2251
+ -----------------------------------------------------------
2252
+  (0.0ms) rollback transaction
2253
+  (0.0ms) begin transaction
2254
+ -------------------------------------------------------------------------------------
2255
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2256
+ -------------------------------------------------------------------------------------
2257
+  (0.0ms) SAVEPOINT active_record_1
2258
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2259
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2260
+  (0.0ms) SAVEPOINT active_record_1
2261
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2262
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2263
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2264
+  (0.0ms) SAVEPOINT active_record_1
2265
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2266
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2267
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2268
+  (0.0ms) SAVEPOINT active_record_1
2269
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2270
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2271
+  (0.0ms) SAVEPOINT active_record_1
2272
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:46:36 UTC +00:00]]
2273
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2274
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2275
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2276
+  (0.1ms) rollback transaction
2277
+  (0.4ms) begin transaction
2278
+ -------------------------------------------------------------------
2279
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2280
+ -------------------------------------------------------------------
2281
+  (0.1ms) rollback transaction
2282
+  (0.0ms) begin transaction
2283
+ --------------------------------------------------------------------------------------------
2284
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2285
+ --------------------------------------------------------------------------------------------
2286
+  (0.1ms) rollback transaction
2287
+  (0.0ms) begin transaction
2288
+ ----------------------------
2289
+ CustomEmailsTest: test_truth
2290
+ ----------------------------
2291
+  (0.0ms) rollback transaction
2292
+  (0.0ms) begin transaction
2293
+ ----------------------------------------------------------------------------------
2294
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2295
+ ----------------------------------------------------------------------------------
2296
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2297
+  (0.0ms) SAVEPOINT active_record_1
2298
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2299
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2300
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2301
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2302
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2303
+  (0.0ms) SAVEPOINT active_record_1
2304
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2305
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2306
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2307
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2308
+  (0.1ms) rollback transaction
2309
+  (0.0ms) begin transaction
2310
+ --------------------------------------------------------------------------
2311
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2312
+ --------------------------------------------------------------------------
2313
+  (0.0ms) SAVEPOINT active_record_1
2314
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2315
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2316
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2317
+  (0.0ms) SAVEPOINT active_record_1
2318
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2319
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2320
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2321
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2322
+  (0.1ms) rollback transaction
2323
+  (0.0ms) begin transaction
2324
+ -----------------------------------------------------------------------------------
2325
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2326
+ -----------------------------------------------------------------------------------
2327
+  (0.0ms) rollback transaction
2328
+  (0.0ms) begin transaction
2329
+ -----------------------------------------------------------------------------
2330
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2331
+ -----------------------------------------------------------------------------
2332
+  (0.0ms) rollback transaction
2333
+  (0.0ms) begin transaction
2334
+ --------------------------------------------------------------------------------------------
2335
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2336
+ --------------------------------------------------------------------------------------------
2337
+  (0.0ms) SAVEPOINT active_record_1
2338
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2339
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2340
+  (0.0ms) SAVEPOINT active_record_1
2341
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2342
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2343
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2344
+  (0.0ms) SAVEPOINT active_record_1
2345
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2346
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2347
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2348
+  (0.1ms) SAVEPOINT active_record_1
2349
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2350
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2351
+  (0.0ms) SAVEPOINT active_record_1
2352
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2353
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2354
+ CustomEmails::Email Load (0.2ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2355
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2356
+  (0.1ms) rollback transaction
2357
+  (0.0ms) begin transaction
2358
+ -----------------------------------------------------------
2359
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2360
+ -----------------------------------------------------------
2361
+  (0.0ms) rollback transaction
2362
+  (0.0ms) begin transaction
2363
+ -------------------------------------------------------------------------------------
2364
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2365
+ -------------------------------------------------------------------------------------
2366
+  (0.0ms) SAVEPOINT active_record_1
2367
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2368
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2369
+  (0.0ms) SAVEPOINT active_record_1
2370
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2371
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2372
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2373
+  (0.0ms) SAVEPOINT active_record_1
2374
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2375
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2376
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2377
+  (0.0ms) SAVEPOINT active_record_1
2378
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2379
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2380
+  (0.1ms) SAVEPOINT active_record_1
2381
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:47:30 UTC +00:00]]
2382
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2383
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2384
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2385
+  (0.1ms) rollback transaction
2386
+  (0.3ms) begin transaction
2387
+ -------------------------------------------------------------------
2388
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2389
+ -------------------------------------------------------------------
2390
+  (0.1ms) rollback transaction
2391
+  (0.0ms) begin transaction
2392
+ --------------------------------------------------------------------------------------------
2393
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2394
+ --------------------------------------------------------------------------------------------
2395
+  (0.1ms) rollback transaction
2396
+  (0.0ms) begin transaction
2397
+ ----------------------------
2398
+ CustomEmailsTest: test_truth
2399
+ ----------------------------
2400
+  (0.0ms) rollback transaction
2401
+  (0.1ms) begin transaction
2402
+ ----------------------------------------------------------------------------------
2403
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2404
+ ----------------------------------------------------------------------------------
2405
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2406
+  (0.0ms) SAVEPOINT active_record_1
2407
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2408
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2409
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2410
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2411
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2412
+  (0.0ms) SAVEPOINT active_record_1
2413
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2414
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2415
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2416
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2417
+  (0.1ms) rollback transaction
2418
+  (0.0ms) begin transaction
2419
+ --------------------------------------------------------------------------
2420
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2421
+ --------------------------------------------------------------------------
2422
+  (0.0ms) SAVEPOINT active_record_1
2423
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2424
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2425
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2426
+  (0.0ms) SAVEPOINT active_record_1
2427
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2428
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2429
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2430
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2431
+
2432
+ Sent mail to test@example.com (5.8ms)
2433
+ Date: Mon, 21 Oct 2013 14:48:23 +0200
2434
+ From: sender@example.org
2435
+ To: test@example.com
2436
+ Message-ID: <5265229798121_5386742ffc873f2@chocapic.mail>
2437
+ Subject: Hello world!
2438
+ Mime-Version: 1.0
2439
+ Content-Type: text/plain;
2440
+ charset=UTF-8
2441
+ Content-Transfer-Encoding: 7bit
2442
+
2443
+ Good luck...
2444
+  (0.2ms) rollback transaction
2445
+  (0.1ms) begin transaction
2446
+ -----------------------------------------------------------------------------------
2447
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2448
+ -----------------------------------------------------------------------------------
2449
+  (0.0ms) rollback transaction
2450
+  (0.0ms) begin transaction
2451
+ -----------------------------------------------------------------------------
2452
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2453
+ -----------------------------------------------------------------------------
2454
+  (0.0ms) rollback transaction
2455
+  (0.0ms) begin transaction
2456
+ --------------------------------------------------------------------------------------------
2457
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2458
+ --------------------------------------------------------------------------------------------
2459
+  (0.0ms) SAVEPOINT active_record_1
2460
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2461
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2462
+  (0.0ms) SAVEPOINT active_record_1
2463
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2464
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2465
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2466
+  (0.0ms) SAVEPOINT active_record_1
2467
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2468
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2469
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2470
+  (0.1ms) SAVEPOINT active_record_1
2471
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2472
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2473
+  (0.0ms) SAVEPOINT active_record_1
2474
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2475
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2476
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2477
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2478
+  (0.1ms) rollback transaction
2479
+  (0.0ms) begin transaction
2480
+ -----------------------------------------------------------
2481
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2482
+ -----------------------------------------------------------
2483
+  (0.1ms) rollback transaction
2484
+  (0.0ms) begin transaction
2485
+ -------------------------------------------------------------------------------------
2486
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2487
+ -------------------------------------------------------------------------------------
2488
+  (0.0ms) SAVEPOINT active_record_1
2489
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2490
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2491
+  (0.0ms) SAVEPOINT active_record_1
2492
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2493
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2494
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2495
+  (0.0ms) SAVEPOINT active_record_1
2496
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2497
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2498
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2499
+  (0.0ms) SAVEPOINT active_record_1
2500
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2501
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2502
+  (0.0ms) SAVEPOINT active_record_1
2503
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:48:23 UTC +00:00]]
2504
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2505
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2506
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2507
+  (0.1ms) rollback transaction
2508
+  (0.3ms) begin transaction
2509
+ -------------------------------------------------------------------------
2510
+ CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail
2511
+ -------------------------------------------------------------------------
2512
+  (0.1ms) rollback transaction
2513
+  (0.0ms) begin transaction
2514
+ -------------------------------------------------------------------
2515
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2516
+ -------------------------------------------------------------------
2517
+  (0.0ms) rollback transaction
2518
+  (0.0ms) begin transaction
2519
+ --------------------------------------------------------------------------------------------
2520
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2521
+ --------------------------------------------------------------------------------------------
2522
+  (0.1ms) rollback transaction
2523
+  (0.1ms) begin transaction
2524
+ ----------------------------
2525
+ CustomEmailsTest: test_truth
2526
+ ----------------------------
2527
+  (0.0ms) rollback transaction
2528
+  (0.0ms) begin transaction
2529
+ ----------------------------------------------------------------------------------
2530
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2531
+ ----------------------------------------------------------------------------------
2532
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2533
+  (0.0ms) SAVEPOINT active_record_1
2534
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2535
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2536
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2537
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2538
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2539
+  (0.0ms) SAVEPOINT active_record_1
2540
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2541
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2542
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2543
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2544
+  (0.1ms) rollback transaction
2545
+  (0.0ms) begin transaction
2546
+ --------------------------------------------------------------------------
2547
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2548
+ --------------------------------------------------------------------------
2549
+  (0.0ms) SAVEPOINT active_record_1
2550
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2551
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2552
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2553
+  (0.0ms) SAVEPOINT active_record_1
2554
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2555
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2556
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2557
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2558
+
2559
+ Sent mail to test@example.com (6.1ms)
2560
+ Date: Mon, 21 Oct 2013 14:49:37 +0200
2561
+ From: sender@example.org
2562
+ To: test@example.com
2563
+ Message-ID: <526522e168a3c_53baa70800162ea@chocapic.mail>
2564
+ Subject: Hello world!
2565
+ Mime-Version: 1.0
2566
+ Content-Type: text/plain;
2567
+ charset=UTF-8
2568
+ Content-Transfer-Encoding: 7bit
2569
+
2570
+ Good luck...
2571
+  (0.1ms) rollback transaction
2572
+  (0.0ms) begin transaction
2573
+ -----------------------------------------------------------------------------------
2574
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2575
+ -----------------------------------------------------------------------------------
2576
+  (0.0ms) rollback transaction
2577
+  (0.0ms) begin transaction
2578
+ -----------------------------------------------------------------------------
2579
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2580
+ -----------------------------------------------------------------------------
2581
+  (0.0ms) rollback transaction
2582
+  (0.0ms) begin transaction
2583
+ --------------------------------------------------------------------------------------------
2584
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2585
+ --------------------------------------------------------------------------------------------
2586
+  (0.0ms) SAVEPOINT active_record_1
2587
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2588
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2589
+  (0.0ms) SAVEPOINT active_record_1
2590
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2591
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2592
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2593
+  (0.0ms) SAVEPOINT active_record_1
2594
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2595
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2596
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2597
+  (0.1ms) SAVEPOINT active_record_1
2598
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2599
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2600
+  (0.0ms) SAVEPOINT active_record_1
2601
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2602
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2603
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2604
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2605
+  (0.1ms) rollback transaction
2606
+  (0.0ms) begin transaction
2607
+ -----------------------------------------------------------
2608
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2609
+ -----------------------------------------------------------
2610
+  (0.1ms) rollback transaction
2611
+  (0.0ms) begin transaction
2612
+ -------------------------------------------------------------------------------------
2613
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2614
+ -------------------------------------------------------------------------------------
2615
+  (0.0ms) SAVEPOINT active_record_1
2616
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2617
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2618
+  (0.0ms) SAVEPOINT active_record_1
2619
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2620
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2621
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2622
+  (0.0ms) SAVEPOINT active_record_1
2623
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2624
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2625
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2626
+  (0.0ms) SAVEPOINT active_record_1
2627
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2628
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2629
+  (0.0ms) SAVEPOINT active_record_1
2630
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:49:37 UTC +00:00]]
2631
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2632
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2633
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2634
+  (0.1ms) rollback transaction
2635
+  (0.3ms) begin transaction
2636
+ -------------------------------------------------------------------------
2637
+ CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail
2638
+ -------------------------------------------------------------------------
2639
+  (0.1ms) rollback transaction
2640
+  (0.1ms) begin transaction
2641
+ -------------------------------------------------------------------
2642
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2643
+ -------------------------------------------------------------------
2644
+  (0.1ms) rollback transaction
2645
+  (0.1ms) begin transaction
2646
+ --------------------------------------------------------------------------------------------
2647
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2648
+ --------------------------------------------------------------------------------------------
2649
+  (0.1ms) rollback transaction
2650
+  (0.0ms) begin transaction
2651
+ ----------------------------
2652
+ CustomEmailsTest: test_truth
2653
+ ----------------------------
2654
+  (0.1ms) rollback transaction
2655
+  (0.0ms) begin transaction
2656
+ ----------------------------------------------------------------------------------
2657
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2658
+ ----------------------------------------------------------------------------------
2659
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2660
+  (0.0ms) SAVEPOINT active_record_1
2661
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2662
+ SQL (0.9ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2663
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2664
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2665
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2666
+  (0.0ms) SAVEPOINT active_record_1
2667
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2668
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2669
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2670
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2671
+  (0.1ms) rollback transaction
2672
+  (0.0ms) begin transaction
2673
+ --------------------------------------------------------------------------
2674
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2675
+ --------------------------------------------------------------------------
2676
+  (0.0ms) SAVEPOINT active_record_1
2677
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2678
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2679
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2680
+  (0.0ms) SAVEPOINT active_record_1
2681
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2682
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2683
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2684
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2685
+
2686
+ Sent mail to test@example.com (6.4ms)
2687
+ Date: Mon, 21 Oct 2013 14:51:15 +0200
2688
+ From: sender@example.org
2689
+ To: test@example.com
2690
+ Message-ID: <5265234327449_53e77df00086f7@chocapic.mail>
2691
+ Subject: Hello world!
2692
+ Mime-Version: 1.0
2693
+ Content-Type: text/plain;
2694
+ charset=UTF-8
2695
+ Content-Transfer-Encoding: 7bit
2696
+
2697
+ Good luck...
2698
+  (0.1ms) rollback transaction
2699
+  (0.0ms) begin transaction
2700
+ -----------------------------------------------------------------------------------
2701
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2702
+ -----------------------------------------------------------------------------------
2703
+  (0.0ms) rollback transaction
2704
+  (0.0ms) begin transaction
2705
+ -----------------------------------------------------------------------------
2706
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2707
+ -----------------------------------------------------------------------------
2708
+  (0.0ms) rollback transaction
2709
+  (0.0ms) begin transaction
2710
+ --------------------------------------------------------------------------------------------
2711
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2712
+ --------------------------------------------------------------------------------------------
2713
+  (0.0ms) SAVEPOINT active_record_1
2714
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2715
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2716
+  (0.0ms) SAVEPOINT active_record_1
2717
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2718
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2719
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2720
+  (0.0ms) SAVEPOINT active_record_1
2721
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2722
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2723
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2724
+  (0.1ms) SAVEPOINT active_record_1
2725
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2726
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2727
+  (0.0ms) SAVEPOINT active_record_1
2728
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2729
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2730
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2731
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2732
+  (0.1ms) rollback transaction
2733
+  (0.0ms) begin transaction
2734
+ -----------------------------------------------------------
2735
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2736
+ -----------------------------------------------------------
2737
+  (0.0ms) rollback transaction
2738
+  (0.0ms) begin transaction
2739
+ -------------------------------------------------------------------------------------
2740
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2741
+ -------------------------------------------------------------------------------------
2742
+  (0.0ms) SAVEPOINT active_record_1
2743
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2744
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2745
+  (0.0ms) SAVEPOINT active_record_1
2746
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2747
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2748
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2749
+  (0.0ms) SAVEPOINT active_record_1
2750
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2751
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2752
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2753
+  (0.0ms) SAVEPOINT active_record_1
2754
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2755
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2756
+  (0.0ms) SAVEPOINT active_record_1
2757
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:51:15 UTC +00:00]]
2758
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2759
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2760
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2761
+  (0.1ms) rollback transaction
2762
+  (0.3ms) begin transaction
2763
+ ----------------------------------------------------------------------------------
2764
+ CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
2765
+ ----------------------------------------------------------------------------------
2766
+  (0.1ms) rollback transaction
2767
+  (0.0ms) begin transaction
2768
+ -------------------------------------------------------------------
2769
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2770
+ -------------------------------------------------------------------
2771
+  (0.0ms) rollback transaction
2772
+  (0.0ms) begin transaction
2773
+ --------------------------------------------------------------------------------------------
2774
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2775
+ --------------------------------------------------------------------------------------------
2776
+  (0.1ms) rollback transaction
2777
+  (0.0ms) begin transaction
2778
+ ----------------------------
2779
+ CustomEmailsTest: test_truth
2780
+ ----------------------------
2781
+  (0.0ms) rollback transaction
2782
+  (0.0ms) begin transaction
2783
+ ----------------------------------------------------------------------------------
2784
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2785
+ ----------------------------------------------------------------------------------
2786
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2787
+  (0.0ms) SAVEPOINT active_record_1
2788
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2789
+ SQL (1.5ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2790
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2791
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2792
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2793
+  (0.0ms) SAVEPOINT active_record_1
2794
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2795
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2796
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2797
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2798
+  (0.1ms) rollback transaction
2799
+  (0.0ms) begin transaction
2800
+ --------------------------------------------------------------------------
2801
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2802
+ --------------------------------------------------------------------------
2803
+  (0.0ms) SAVEPOINT active_record_1
2804
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2805
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2806
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2807
+  (0.0ms) SAVEPOINT active_record_1
2808
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2809
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2810
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2811
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2812
+
2813
+ Sent mail to test@example.com (6.3ms)
2814
+ Date: Mon, 21 Oct 2013 14:51:18 +0200
2815
+ From: sender@example.org
2816
+ To: test@example.com
2817
+ Message-ID: <52652346d7db7_54188d2ffc6897d@chocapic.mail>
2818
+ Subject: Hello world!
2819
+ Mime-Version: 1.0
2820
+ Content-Type: text/plain;
2821
+ charset=UTF-8
2822
+ Content-Transfer-Encoding: 7bit
2823
+
2824
+ Good luck...
2825
+  (0.1ms) rollback transaction
2826
+  (0.0ms) begin transaction
2827
+ -----------------------------------------------------------------------------------
2828
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2829
+ -----------------------------------------------------------------------------------
2830
+  (0.0ms) rollback transaction
2831
+  (0.0ms) begin transaction
2832
+ -----------------------------------------------------------------------------
2833
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2834
+ -----------------------------------------------------------------------------
2835
+  (0.0ms) rollback transaction
2836
+  (0.0ms) begin transaction
2837
+ --------------------------------------------------------------------------------------------
2838
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2839
+ --------------------------------------------------------------------------------------------
2840
+  (0.0ms) SAVEPOINT active_record_1
2841
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2842
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2843
+  (0.0ms) SAVEPOINT active_record_1
2844
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2845
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2846
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2847
+  (0.0ms) SAVEPOINT active_record_1
2848
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2849
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2850
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2851
+  (0.1ms) SAVEPOINT active_record_1
2852
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2853
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2854
+  (0.0ms) SAVEPOINT active_record_1
2855
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2856
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2857
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2858
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2859
+  (0.1ms) rollback transaction
2860
+  (0.0ms) begin transaction
2861
+ -----------------------------------------------------------
2862
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
2863
+ -----------------------------------------------------------
2864
+  (0.1ms) rollback transaction
2865
+  (0.0ms) begin transaction
2866
+ -------------------------------------------------------------------------------------
2867
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
2868
+ -------------------------------------------------------------------------------------
2869
+  (0.0ms) SAVEPOINT active_record_1
2870
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2871
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2872
+  (0.0ms) SAVEPOINT active_record_1
2873
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2874
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2875
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2876
+  (0.0ms) SAVEPOINT active_record_1
2877
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2878
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2879
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2880
+  (0.0ms) SAVEPOINT active_record_1
2881
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2882
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2883
+  (0.0ms) SAVEPOINT active_record_1
2884
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:51:18 UTC +00:00]]
2885
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2886
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
2887
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
2888
+  (0.1ms) rollback transaction
2889
+  (0.3ms) begin transaction
2890
+ ----------------------------------------------------------------------------------
2891
+ CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
2892
+ ----------------------------------------------------------------------------------
2893
+
2894
+ Sent mail to foo@bar.org (4.3ms)
2895
+ Date: Mon, 21 Oct 2013 14:51:59 +0200
2896
+ To: foo@bar.org
2897
+ Message-ID: <5265236f8f93f_5446131a000149a@chocapic.mail>
2898
+ Subject: Email to
2899
+ Mime-Version: 1.0
2900
+ Content-Type: text/plain;
2901
+ charset=UTF-8
2902
+ Content-Transfer-Encoding: 7bit
2903
+
2904
+
2905
+  (0.1ms) rollback transaction
2906
+  (0.0ms) begin transaction
2907
+ -------------------------------------------------------------------
2908
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
2909
+ -------------------------------------------------------------------
2910
+  (0.0ms) rollback transaction
2911
+  (0.0ms) begin transaction
2912
+ --------------------------------------------------------------------------------------------
2913
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
2914
+ --------------------------------------------------------------------------------------------
2915
+  (0.1ms) rollback transaction
2916
+  (0.0ms) begin transaction
2917
+ ----------------------------
2918
+ CustomEmailsTest: test_truth
2919
+ ----------------------------
2920
+  (0.0ms) rollback transaction
2921
+  (0.0ms) begin transaction
2922
+ ----------------------------------------------------------------------------------
2923
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
2924
+ ----------------------------------------------------------------------------------
2925
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2926
+  (0.0ms) SAVEPOINT active_record_1
2927
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2928
+ SQL (1.4ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2929
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2930
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2931
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2932
+  (0.0ms) SAVEPOINT active_record_1
2933
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2934
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2935
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2936
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2937
+  (0.1ms) rollback transaction
2938
+  (0.0ms) begin transaction
2939
+ --------------------------------------------------------------------------
2940
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
2941
+ --------------------------------------------------------------------------
2942
+  (0.0ms) SAVEPOINT active_record_1
2943
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2944
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2945
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2946
+  (0.0ms) SAVEPOINT active_record_1
2947
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2948
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2949
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2950
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
2951
+
2952
+ Sent mail to test@example.com (3.5ms)
2953
+ Date: Mon, 21 Oct 2013 14:51:59 +0200
2954
+ From: sender@example.org
2955
+ To: test@example.com
2956
+ Message-ID: <5265236fa1ecb_5446131a000156a@chocapic.mail>
2957
+ Subject: Hello world!
2958
+ Mime-Version: 1.0
2959
+ Content-Type: text/plain;
2960
+ charset=UTF-8
2961
+ Content-Transfer-Encoding: 7bit
2962
+
2963
+ Good luck...
2964
+  (0.1ms) rollback transaction
2965
+  (0.0ms) begin transaction
2966
+ -----------------------------------------------------------------------------------
2967
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
2968
+ -----------------------------------------------------------------------------------
2969
+  (0.0ms) rollback transaction
2970
+  (0.0ms) begin transaction
2971
+ -----------------------------------------------------------------------------
2972
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
2973
+ -----------------------------------------------------------------------------
2974
+  (0.0ms) rollback transaction
2975
+  (0.0ms) begin transaction
2976
+ --------------------------------------------------------------------------------------------
2977
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
2978
+ --------------------------------------------------------------------------------------------
2979
+  (0.0ms) SAVEPOINT active_record_1
2980
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
2981
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2982
+  (0.0ms) SAVEPOINT active_record_1
2983
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
2984
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2985
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2986
+  (0.0ms) SAVEPOINT active_record_1
2987
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
2988
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2989
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2990
+  (0.1ms) SAVEPOINT active_record_1
2991
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2992
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2993
+  (0.0ms) SAVEPOINT active_record_1
2994
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
2995
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2996
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
2997
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
2998
+  (0.1ms) rollback transaction
2999
+  (0.0ms) begin transaction
3000
+ -----------------------------------------------------------
3001
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
3002
+ -----------------------------------------------------------
3003
+  (0.1ms) rollback transaction
3004
+  (0.1ms) begin transaction
3005
+ -------------------------------------------------------------------------------------
3006
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
3007
+ -------------------------------------------------------------------------------------
3008
+  (0.0ms) SAVEPOINT active_record_1
3009
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
3010
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3011
+  (0.0ms) SAVEPOINT active_record_1
3012
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3013
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
3014
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3015
+  (0.0ms) SAVEPOINT active_record_1
3016
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
3017
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
3018
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3019
+  (0.0ms) SAVEPOINT active_record_1
3020
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
3021
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3022
+  (0.0ms) SAVEPOINT active_record_1
3023
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:51:59 UTC +00:00]]
3024
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3025
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
3026
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
3027
+  (0.1ms) rollback transaction
3028
+  (0.3ms) begin transaction
3029
+ ----------------------------------------------------------------------------------
3030
+ CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
3031
+ ----------------------------------------------------------------------------------
3032
+
3033
+ Sent mail to foo@bar.org (6.0ms)
3034
+ Date: Mon, 21 Oct 2013 14:53:08 +0200
3035
+ From: sender@example.org
3036
+ To: foo@bar.org
3037
+ Message-ID: <526523b480093_5477b8cff45873a@chocapic.mail>
3038
+ Subject: Email to
3039
+ Mime-Version: 1.0
3040
+ Content-Type: text/plain;
3041
+ charset=UTF-8
3042
+ Content-Transfer-Encoding: 7bit
3043
+
3044
+
3045
+  (0.1ms) rollback transaction
3046
+  (0.0ms) begin transaction
3047
+ -------------------------------------------------------------------
3048
+ CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
3049
+ -------------------------------------------------------------------
3050
+  (0.0ms) rollback transaction
3051
+  (0.0ms) begin transaction
3052
+ --------------------------------------------------------------------------------------------
3053
+ CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
3054
+ --------------------------------------------------------------------------------------------
3055
+  (0.1ms) rollback transaction
3056
+  (0.0ms) begin transaction
3057
+ ----------------------------
3058
+ CustomEmailsTest: test_truth
3059
+ ----------------------------
3060
+  (0.0ms) rollback transaction
3061
+  (0.0ms) begin transaction
3062
+ ----------------------------------------------------------------------------------
3063
+ MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
3064
+ ----------------------------------------------------------------------------------
3065
+ CustomEmails::EmailKind Load (0.2ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3066
+  (0.0ms) SAVEPOINT active_record_1
3067
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3068
+ SQL (1.3ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3069
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3070
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3071
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
3072
+  (0.0ms) SAVEPOINT active_record_1
3073
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3074
+  (0.1ms) RELEASE SAVEPOINT active_record_1
3075
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3076
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
3077
+  (0.1ms) rollback transaction
3078
+  (0.0ms) begin transaction
3079
+ --------------------------------------------------------------------------
3080
+ MailerTest: test_email_content_text_is_used_when_custom_email_to_is_called
3081
+ --------------------------------------------------------------------------
3082
+  (0.0ms) SAVEPOINT active_record_1
3083
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3084
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3085
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3086
+  (0.0ms) SAVEPOINT active_record_1
3087
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck..."], ["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello world!"], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3088
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3089
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3090
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."kind_id" = 1 AND "custom_emails_emails"."emailable_id" IS NULL AND "custom_emails_emails"."locale" = 'en' LIMIT 1
3091
+
3092
+ Sent mail to test@example.com (3.3ms)
3093
+ Date: Mon, 21 Oct 2013 14:53:08 +0200
3094
+ From: sender@example.org
3095
+ To: test@example.com
3096
+ Message-ID: <526523b4926e2_5477b8cff45886b@chocapic.mail>
3097
+ Subject: Hello world!
3098
+ Mime-Version: 1.0
3099
+ Content-Type: text/plain;
3100
+ charset=UTF-8
3101
+ Content-Transfer-Encoding: 7bit
3102
+
3103
+ Good luck...
3104
+  (0.1ms) rollback transaction
3105
+  (0.0ms) begin transaction
3106
+ -----------------------------------------------------------------------------------
3107
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
3108
+ -----------------------------------------------------------------------------------
3109
+  (0.1ms) rollback transaction
3110
+  (0.0ms) begin transaction
3111
+ -----------------------------------------------------------------------------
3112
+ ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
3113
+ -----------------------------------------------------------------------------
3114
+  (0.0ms) rollback transaction
3115
+  (0.0ms) begin transaction
3116
+ --------------------------------------------------------------------------------------------
3117
+ ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
3118
+ --------------------------------------------------------------------------------------------
3119
+  (0.0ms) SAVEPOINT active_record_1
3120
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
3121
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3122
+  (0.0ms) SAVEPOINT active_record_1
3123
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3124
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3125
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3126
+  (0.0ms) SAVEPOINT active_record_1
3127
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
3128
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3129
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3130
+  (0.1ms) SAVEPOINT active_record_1
3131
+ SQL (0.3ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3132
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3133
+  (0.0ms) SAVEPOINT active_record_1
3134
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Faux corps 2"], ["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3135
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3136
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? AND "custom_emails_emails"."locale" = 'fr' [["emailable_id", 1], ["emailable_type", "Example"]]
3137
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
3138
+  (0.1ms) rollback transaction
3139
+  (0.0ms) begin transaction
3140
+ -----------------------------------------------------------
3141
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
3142
+ -----------------------------------------------------------
3143
+  (0.1ms) rollback transaction
3144
+  (0.0ms) begin transaction
3145
+ -------------------------------------------------------------------------------------
3146
+ ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
3147
+ -------------------------------------------------------------------------------------
3148
+  (0.0ms) SAVEPOINT active_record_1
3149
+ SQL (0.1ms) INSERT INTO "examples" DEFAULT VALUES
3150
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3151
+  (0.0ms) SAVEPOINT active_record_1
3152
+ CustomEmails::EmailKind Exists (0.1ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
3153
+ SQL (0.2ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["name", :kind_1], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3154
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3155
+  (0.0ms) SAVEPOINT active_record_1
3156
+ CustomEmails::EmailKind Exists (0.0ms) SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
3157
+ SQL (0.1ms) INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["name", :kind_2], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3158
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3159
+  (0.0ms) SAVEPOINT active_record_1
3160
+ SQL (0.1ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body"], ["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3161
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3162
+  (0.0ms) SAVEPOINT active_record_1
3163
+ SQL (0.2ms) INSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["content_text", "Fake body 2"], ["created_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Mon, 21 Oct 2013 12:53:08 UTC +00:00]]
3164
+  (0.0ms) RELEASE SAVEPOINT active_record_1
3165
+ CustomEmails::Email Load (0.1ms) SELECT "custom_emails_emails".* FROM "custom_emails_emails" WHERE "custom_emails_emails"."emailable_id" = ? AND "custom_emails_emails"."emailable_type" = ? [["emailable_id", 1], ["emailable_type", "Example"]]
3166
+ CustomEmails::EmailKind Load (0.1ms) SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)
3167
+  (0.1ms) rollback transaction