custom_emails 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/app/models/custom_emails/email.rb +3 -27
- data/app/models/custom_emails/short_message.rb +27 -0
- data/app/models/custom_emails/short_message_kind.rb +8 -0
- data/db/migrate/20131224105400_create_custom_emails_short_messages.rb +20 -0
- data/db/migrate/20131224105500_create_custom_emails_short_message_kinds.rb +11 -0
- data/lib/custom_emails.rb +3 -0
- data/lib/custom_emails/models.rb +14 -0
- data/lib/custom_emails/templatable.rb +34 -0
- data/lib/custom_emails/version.rb +1 -1
- data/lib/generators/templates/custom_emails.rb +1 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +24 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +1133 -0
- data/test/dummy/log/test.log +465 -0
- data/test/models/custom_emails/short_message_test.rb +35 -0
- data/test/test_models.rb +1 -0
- metadata +18 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cf7db0fb0e07a50a467b5b7f728ccc28649bb2fa
|
4
|
+
data.tar.gz: f993ce6df4d7c416ce6b2d2b9b3fbfaf237f14a0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4789b60304027a849e6eb4ed1d5a400975d9717941d37fe90f449ee9d97959f734ee253c0cde75111bb0d49886cccd9076956aaca5f84275de88d034a74a71c1
|
7
|
+
data.tar.gz: 6a0263461c51eac73dcddd6bf424d75e13416d1db30cb38b45165597a301d2e79a2d7e20670da14febe038e93eb4556827c49eb1d7f331ce928140bf14eb398b
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'liquid'
|
2
|
-
|
3
1
|
module CustomEmails
|
4
2
|
class Email < ActiveRecord::Base
|
3
|
+
include Templatable
|
4
|
+
|
5
5
|
if CustomEmails.scoped
|
6
6
|
belongs_to :emailable, polymorphic: true
|
7
7
|
end
|
@@ -18,35 +18,11 @@ module CustomEmails
|
|
18
18
|
|
19
19
|
# Create an interpolated version of some attributes
|
20
20
|
%w(subject content_text content_html).each do |attr|
|
21
|
-
class_eval "def interpolated_#{attr}(context) ; interpolate(#{attr}, context) end"
|
22
|
-
end
|
23
|
-
|
24
|
-
# Checks if a content is valid for interpolation.
|
25
|
-
#
|
26
|
-
# @return [Boolean]
|
27
|
-
def self.valid_template?(content)
|
28
|
-
return true if content.blank?
|
29
|
-
|
30
|
-
template = ::Liquid::Template.parse(content)
|
31
|
-
template.errors.empty?
|
21
|
+
class_eval "def interpolated_#{attr}(context) ; self.class.interpolate(#{attr}, context) end"
|
32
22
|
end
|
33
23
|
|
34
24
|
private
|
35
25
|
|
36
|
-
# Use liquid to get the result of template interpretation.
|
37
|
-
#
|
38
|
-
# @param [String] the template
|
39
|
-
# @param [Hash] the variable tree that have to be inserted into the template
|
40
|
-
# @retrun [String]
|
41
|
-
def interpolate(content, context)
|
42
|
-
template = ::Liquid::Template.parse(content)
|
43
|
-
if template.errors.empty?
|
44
|
-
template.render(context)
|
45
|
-
else
|
46
|
-
content
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
26
|
def ensure_valid_templates
|
51
27
|
if content_text.present? && !self.class.valid_template?(content_text)
|
52
28
|
errors.add(:content_text, 'errors are found in the content_text template')
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module CustomEmails
|
2
|
+
class ShortMessage < ActiveRecord::Base
|
3
|
+
include Templatable
|
4
|
+
|
5
|
+
if CustomEmails.scoped_sms
|
6
|
+
belongs_to :messageable, polymorphic: true
|
7
|
+
end
|
8
|
+
|
9
|
+
belongs_to :kind, class_name: ShortMessageKind, inverse_of: :short_messages
|
10
|
+
|
11
|
+
validates_presence_of :locale, :content, :kind
|
12
|
+
validate :ensure_valid_templates
|
13
|
+
|
14
|
+
# Create an interpolated version of some attributes
|
15
|
+
%w(content).each do |attr|
|
16
|
+
class_eval "def interpolated_#{attr}(context) ; self.class.interpolate(#{attr}, context) end"
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def ensure_valid_templates
|
22
|
+
if content.present? && !self.class.valid_template?(content)
|
23
|
+
errors.add(:content, 'errors are found in the content template')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateCustomEmailsShortMessages < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :custom_emails_short_messages do |t|
|
4
|
+
t.integer :messageable_id
|
5
|
+
t.string :messageable_type
|
6
|
+
t.integer :kind_id
|
7
|
+
t.string :locale
|
8
|
+
t.text :content
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :custom_emails_short_messages, :locale
|
14
|
+
add_index :custom_emails_short_messages, :messageable_id
|
15
|
+
add_index :custom_emails_short_messages, [:kind_id, :messageable_id], name: 'index_w_kind_and_messageable'
|
16
|
+
|
17
|
+
# The uniqueness of the (kind, locale, messageable) tuple is ensured here
|
18
|
+
add_index :custom_emails_short_messages, [:kind_id, :locale, :messageable_id, :messageable_type], unique: true, name: 'unique_w_kind_locale_and_messageable'
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class CreateCustomEmailsShortMessageKinds < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :custom_emails_short_message_kinds do |t|
|
4
|
+
t.string :name
|
5
|
+
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
|
9
|
+
add_index :custom_emails_short_message_kinds, :name, unique: true
|
10
|
+
end
|
11
|
+
end
|
data/lib/custom_emails.rb
CHANGED
@@ -2,11 +2,14 @@ require 'custom_emails/engine'
|
|
2
2
|
|
3
3
|
module CustomEmails
|
4
4
|
@@scoped = true
|
5
|
+
@@scoped_sms = true
|
5
6
|
@@default_locale = :en
|
6
7
|
|
7
8
|
mattr_accessor :default_locale
|
8
9
|
mattr_accessor :default_from
|
9
10
|
mattr_accessor :scoped
|
11
|
+
mattr_accessor :scoped_sms
|
10
12
|
|
11
13
|
autoload :Models, 'custom_emails/models'
|
14
|
+
autoload :Templatable, 'custom_emails/templatable'
|
12
15
|
end
|
data/lib/custom_emails/models.rb
CHANGED
@@ -13,5 +13,19 @@ module CustomEmails
|
|
13
13
|
assoc.group_by(&:kind)
|
14
14
|
end"
|
15
15
|
end
|
16
|
+
|
17
|
+
def has_custom_short_messages(options={})
|
18
|
+
options = options.reverse_merge({
|
19
|
+
as: :short_messages
|
20
|
+
})
|
21
|
+
|
22
|
+
has_many options[:as], as: :messageable, class_name: ::CustomEmails::ShortMessage, dependent: :destroy
|
23
|
+
|
24
|
+
class_eval "def #{options[:as]}_by_kind(locale=nil)
|
25
|
+
assoc = #{options[:as]}.includes(:kind)
|
26
|
+
assoc = assoc.where(locale: locale) if locale
|
27
|
+
assoc.group_by(&:kind)
|
28
|
+
end"
|
29
|
+
end
|
16
30
|
end
|
17
31
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
require 'liquid'
|
3
|
+
|
4
|
+
module CustomEmails
|
5
|
+
module Templatable
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
# Checks if a content is valid for interpolation.
|
10
|
+
#
|
11
|
+
# @return [Boolean]
|
12
|
+
def valid_template?(content)
|
13
|
+
return true if content.blank?
|
14
|
+
|
15
|
+
template = ::Liquid::Template.parse(content)
|
16
|
+
template.errors.empty?
|
17
|
+
end
|
18
|
+
|
19
|
+
# Use liquid to get the result of template interpretation.
|
20
|
+
#
|
21
|
+
# @param [String] the template
|
22
|
+
# @param [Hash] the variable tree that have to be inserted into the template
|
23
|
+
# @retrun [String]
|
24
|
+
def interpolate(content, context)
|
25
|
+
template = ::Liquid::Template.parse(content)
|
26
|
+
if template.errors.empty?
|
27
|
+
template.render(context)
|
28
|
+
else
|
29
|
+
content
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -8,6 +8,7 @@ require 'custom_emails/orm/active_record'
|
|
8
8
|
# custom_emails with this option. The default is true
|
9
9
|
#
|
10
10
|
#CustomEmails.scoped = false
|
11
|
+
#CustomEmails.scoped_sms = false
|
11
12
|
|
12
13
|
# You can customize the default sender of the custom emails here.
|
13
14
|
# This will be used by CustomEmails::Mailer#custom_email_to
|
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20131224105500) do
|
15
15
|
|
16
16
|
create_table "custom_emails_email_kinds", force: true do |t|
|
17
17
|
t.string "name"
|
@@ -38,6 +38,29 @@ ActiveRecord::Schema.define(version: 20131018164626) do
|
|
38
38
|
add_index "custom_emails_emails", ["kind_id", "locale", "emailable_id", "emailable_type"], name: "unique_w_kind_locale_and_emailable", unique: true
|
39
39
|
add_index "custom_emails_emails", ["locale"], name: "index_custom_emails_emails_on_locale"
|
40
40
|
|
41
|
+
create_table "custom_emails_short_message_kinds", force: true do |t|
|
42
|
+
t.string "name"
|
43
|
+
t.datetime "created_at"
|
44
|
+
t.datetime "updated_at"
|
45
|
+
end
|
46
|
+
|
47
|
+
add_index "custom_emails_short_message_kinds", ["name"], name: "index_custom_emails_short_message_kinds_on_name", unique: true
|
48
|
+
|
49
|
+
create_table "custom_emails_short_messages", force: true do |t|
|
50
|
+
t.integer "messageable_id"
|
51
|
+
t.string "messageable_type"
|
52
|
+
t.integer "kind_id"
|
53
|
+
t.string "locale"
|
54
|
+
t.text "content"
|
55
|
+
t.datetime "created_at"
|
56
|
+
t.datetime "updated_at"
|
57
|
+
end
|
58
|
+
|
59
|
+
add_index "custom_emails_short_messages", ["kind_id", "locale", "messageable_id", "messageable_type"], name: "unique_w_kind_locale_and_messageable", unique: true
|
60
|
+
add_index "custom_emails_short_messages", ["kind_id", "messageable_id"], name: "index_w_kind_and_messageable"
|
61
|
+
add_index "custom_emails_short_messages", ["locale"], name: "index_custom_emails_short_messages_on_locale"
|
62
|
+
add_index "custom_emails_short_messages", ["messageable_id"], name: "index_custom_emails_short_messages_on_messageable_id"
|
63
|
+
|
41
64
|
create_table "examples", force: true do |t|
|
42
65
|
end
|
43
66
|
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -1199,3 +1199,1136 @@ Migrating to CreateExamples (20131018164626)
|
|
1199
1199
|
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131018164626"]]
|
1200
1200
|
[1m[36m (82.0ms)[0m [1mcommit transaction[0m
|
1201
1201
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1202
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1203
|
+
Migrating to CreateCustomEmailsShortMessages (20131224105400)
|
1204
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1205
|
+
Migrating to CreateCustomEmailsShortMessages (20131224105400)
|
1206
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1207
|
+
[1m[36m (19.5ms)[0m [1mCREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime) [0m
|
1208
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")
|
1209
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")[0m
|
1210
|
+
[1m[35m (0.5ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_kind_id_and_emailable_id" ON "custom_emails_short_messages" ("kind_id", "emailable_id")
|
1211
|
+
SQLite3::SQLException: table custom_emails_short_messages has no column named emailable_id: CREATE INDEX "index_custom_emails_short_messages_on_kind_id_and_emailable_id" ON "custom_emails_short_messages" ("kind_id", "emailable_id")
|
1212
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1213
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1214
|
+
Migrating to CreateCustomEmailsShortMessages (20131224105400)
|
1215
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1216
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime) [0m
|
1217
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")
|
1218
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")[0m
|
1219
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1220
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1221
|
+
Migrating to CreateCustomEmailsShortMessages (20131224105400)
|
1222
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1223
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime) [0m
|
1224
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")
|
1225
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")[0m
|
1226
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
1227
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
1228
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131224105400"]]
|
1229
|
+
[1m[36m (76.5ms)[0m [1mcommit transaction[0m
|
1230
|
+
Migrating to CreateCustomEmailsShortMessageKinds (20131224105500)
|
1231
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1232
|
+
[1m[36m (0.4ms)[0m [1mCREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
1233
|
+
[1m[35m (0.3ms)[0m CREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")
|
1234
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20131224105500"]]
|
1235
|
+
[1m[35m (89.5ms)[0m commit transaction
|
1236
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1237
|
+
[1m[36m (85.0ms)[0m [1mCREATE TABLE "custom_emails_email_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
1238
|
+
[1m[35m (77.4ms)[0m CREATE UNIQUE INDEX "index_custom_emails_email_kinds_on_name" ON "custom_emails_email_kinds" ("name")
|
1239
|
+
[1m[36m (142.7ms)[0m [1mCREATE TABLE "custom_emails_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "emailable_id" integer, "emailable_type" varchar(255), "locale" varchar(255), "subject" text, "content_text" text, "content_html" text, "created_at" datetime, "updated_at" datetime, "kind_id" integer) [0m
|
1240
|
+
[1m[35m (51.4ms)[0m CREATE INDEX "index_custom_emails_emails_on_emailable_id" ON "custom_emails_emails" ("emailable_id")
|
1241
|
+
[1m[36m (51.3ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_kind_id_and_emailable_id" ON "custom_emails_emails" ("kind_id", "emailable_id")[0m
|
1242
|
+
[1m[35m (51.0ms)[0m CREATE UNIQUE INDEX "unique_w_kind_locale_and_emailable" ON "custom_emails_emails" ("kind_id", "locale", "emailable_id", "emailable_type")
|
1243
|
+
[1m[36m (126.6ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_locale" ON "custom_emails_emails" ("locale")[0m
|
1244
|
+
[1m[35m (50.8ms)[0m CREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
|
1245
|
+
[1m[36m (51.7ms)[0m [1mCREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")[0m
|
1246
|
+
[1m[35m (50.8ms)[0m CREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime)
|
1247
|
+
[1m[36m (119.2ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
1248
|
+
[1m[35m (51.6ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
1249
|
+
[1m[36m (51.0ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")[0m
|
1250
|
+
[1m[35m (59.2ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")
|
1251
|
+
[1m[36m (127.1ms)[0m [1mCREATE TABLE "examples" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) [0m
|
1252
|
+
[1m[35m (49.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
1253
|
+
[1m[36m (51.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1254
|
+
[1m[35m (0.2ms)[0m SELECT version FROM "schema_migrations"
|
1255
|
+
[1m[36m (50.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105500')[0m
|
1256
|
+
[1m[35m (102.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018164626')
|
1257
|
+
[1m[36m (51.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105400')[0m
|
1258
|
+
[1m[35m (51.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018143726')
|
1259
|
+
[1m[36m (51.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131018141445')[0m
|
1260
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1261
|
+
----------------------------------------------------------------------------------
|
1262
|
+
CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
|
1263
|
+
----------------------------------------------------------------------------------
|
1264
|
+
|
1265
|
+
Sent mail to foo@bar.org (19.0ms)
|
1266
|
+
Date: Tue, 24 Dec 2013 12:17:32 +0100
|
1267
|
+
From: sender@example.org
|
1268
|
+
To: foo@bar.org
|
1269
|
+
Message-ID: <52b96d4c57174_34a23f8dce25be80187d7@chocapic.mail>
|
1270
|
+
Subject:
|
1271
|
+
Mime-Version: 1.0
|
1272
|
+
Content-Type: text/plain;
|
1273
|
+
charset=UTF-8
|
1274
|
+
Content-Transfer-Encoding: 7bit
|
1275
|
+
|
1276
|
+
|
1277
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1278
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1279
|
+
----------------------------------------------------------------------------------------------------------
|
1280
|
+
CustomEmails::EmailTest: test_email_has_interpolation_via_liquid_on_subject,_content_text_and_content_html
|
1281
|
+
----------------------------------------------------------------------------------------------------------
|
1282
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1283
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1284
|
+
-------------------------------------------------------------------
|
1285
|
+
CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
|
1286
|
+
-------------------------------------------------------------------
|
1287
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1288
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1289
|
+
--------------------------------------------------------------------------------------------
|
1290
|
+
CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
|
1291
|
+
--------------------------------------------------------------------------------------------
|
1292
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1293
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1294
|
+
------------------------------------------------------------------------------------------
|
1295
|
+
CustomEmails::ShortMessageTest: test_Short_message_has_interpolation_via_liquid_on_content
|
1296
|
+
------------------------------------------------------------------------------------------
|
1297
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1298
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1299
|
+
------------------------------------------------------------------------------------
|
1300
|
+
CustomEmails::ShortMessageTest: test_short_message_is_scoped_to_an_messageable_model
|
1301
|
+
------------------------------------------------------------------------------------
|
1302
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1303
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1304
|
+
---------------------------------------------------------------------------------------------
|
1305
|
+
CustomEmails::ShortMessageTest: test_short_message_needs_kind,_locale_and_content_to_be_valid
|
1306
|
+
---------------------------------------------------------------------------------------------
|
1307
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1308
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1309
|
+
----------------------------
|
1310
|
+
CustomEmailsTest: test_truth
|
1311
|
+
----------------------------
|
1312
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1313
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1314
|
+
----------------------------------------------------------------------------------
|
1315
|
+
MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
|
1316
|
+
----------------------------------------------------------------------------------
|
1317
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1318
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1319
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1320
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1321
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1322
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1323
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1324
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1325
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content_text", "Good luck..."], ["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1326
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1327
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1328
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
1329
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1330
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1331
|
+
--------------------------------------------------------------------------------------
|
1332
|
+
MailerTest: test_email_interpolated_attributes_are_used_when_custom_email_to_is_called
|
1333
|
+
--------------------------------------------------------------------------------------
|
1334
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1335
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1336
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1337
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1338
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1339
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck {{ name }}..."], ["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello {{ name }}!"], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1340
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1341
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1342
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1343
|
+
|
1344
|
+
Sent mail to test@example.com (3.7ms)
|
1345
|
+
Date: Tue, 24 Dec 2013 12:17:32 +0100
|
1346
|
+
From: sender@example.org
|
1347
|
+
To: test@example.com
|
1348
|
+
Message-ID: <52b96d4c69662_34a23f8dce25be8018832@chocapic.mail>
|
1349
|
+
Subject: Hello Luc!
|
1350
|
+
Mime-Version: 1.0
|
1351
|
+
Content-Type: text/plain;
|
1352
|
+
charset=UTF-8
|
1353
|
+
Content-Transfer-Encoding: 7bit
|
1354
|
+
|
1355
|
+
Good luck Luc...
|
1356
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1357
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
1358
|
+
-----------------------------------------------------------------------------------
|
1359
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
|
1360
|
+
-----------------------------------------------------------------------------------
|
1361
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1362
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1363
|
+
-----------------------------------------------------------------------------
|
1364
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
|
1365
|
+
-----------------------------------------------------------------------------
|
1366
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1367
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1368
|
+
--------------------------------------------------------------------------------------------
|
1369
|
+
ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
|
1370
|
+
--------------------------------------------------------------------------------------------
|
1371
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1372
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "examples" DEFAULT VALUES[0m
|
1373
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1374
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1375
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1376
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1377
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1378
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1379
|
+
[1m[35mCustomEmails::EmailKind Exists (0.0ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
|
1380
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1381
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1382
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1383
|
+
[1m[35mSQL (0.2ms)[0m 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", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1384
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1385
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1386
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Faux corps 2"], ["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1387
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1388
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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'[0m [["emailable_id", 1], ["emailable_type", "Example"]]
|
1389
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
|
1390
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1391
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1392
|
+
-----------------------------------------------------------
|
1393
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
|
1394
|
+
-----------------------------------------------------------
|
1395
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1396
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1397
|
+
-------------------------------------------------------------------------------------
|
1398
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
|
1399
|
+
-------------------------------------------------------------------------------------
|
1400
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1401
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "examples" DEFAULT VALUES
|
1402
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1403
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1404
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1405
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1406
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1407
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1408
|
+
[1m[36mCustomEmails::EmailKind Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1[0m
|
1409
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1410
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1411
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1412
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Fake body"], ["created_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1413
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1414
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1415
|
+
[1m[35mSQL (0.1ms)[0m 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", Tue, 24 Dec 2013 11:17:32 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Tue, 24 Dec 2013 11:17:32 UTC +00:00]]
|
1416
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1417
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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"]]
|
1418
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)[0m
|
1419
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1420
|
+
[1m[36m (83.8ms)[0m [1mCREATE TABLE "custom_emails_email_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
1421
|
+
[1m[35m (51.0ms)[0m CREATE UNIQUE INDEX "index_custom_emails_email_kinds_on_name" ON "custom_emails_email_kinds" ("name")
|
1422
|
+
[1m[36m (67.6ms)[0m [1mCREATE TABLE "custom_emails_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "emailable_id" integer, "emailable_type" varchar(255), "locale" varchar(255), "subject" text, "content_text" text, "content_html" text, "created_at" datetime, "updated_at" datetime, "kind_id" integer) [0m
|
1423
|
+
[1m[35m (123.7ms)[0m CREATE INDEX "index_custom_emails_emails_on_emailable_id" ON "custom_emails_emails" ("emailable_id")
|
1424
|
+
[1m[36m (169.2ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_kind_id_and_emailable_id" ON "custom_emails_emails" ("kind_id", "emailable_id")[0m
|
1425
|
+
[1m[35m (50.8ms)[0m CREATE UNIQUE INDEX "unique_w_kind_locale_and_emailable" ON "custom_emails_emails" ("kind_id", "locale", "emailable_id", "emailable_type")
|
1426
|
+
[1m[36m (50.9ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_locale" ON "custom_emails_emails" ("locale")[0m
|
1427
|
+
[1m[35m (50.9ms)[0m CREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
|
1428
|
+
[1m[36m (119.3ms)[0m [1mCREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")[0m
|
1429
|
+
[1m[35m (51.1ms)[0m CREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime)
|
1430
|
+
[1m[36m (51.5ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
1431
|
+
[1m[35m (68.3ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
1432
|
+
[1m[36m (126.5ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")[0m
|
1433
|
+
[1m[35m (60.1ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")
|
1434
|
+
[1m[36m (51.5ms)[0m [1mCREATE TABLE "examples" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) [0m
|
1435
|
+
[1m[35m (169.5ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
1436
|
+
[1m[36m (57.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1437
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1438
|
+
[1m[36m (51.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105500')[0m
|
1439
|
+
[1m[35m (52.9ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018164626')
|
1440
|
+
[1m[36m (127.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105400')[0m
|
1441
|
+
[1m[35m (51.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018143726')
|
1442
|
+
[1m[36m (51.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131018141445')[0m
|
1443
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1444
|
+
----------------------------------------------------------------------------------
|
1445
|
+
CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
|
1446
|
+
----------------------------------------------------------------------------------
|
1447
|
+
|
1448
|
+
Sent mail to foo@bar.org (5.4ms)
|
1449
|
+
Date: Tue, 24 Dec 2013 12:19:01 +0100
|
1450
|
+
From: sender@example.org
|
1451
|
+
To: foo@bar.org
|
1452
|
+
Message-ID: <52b96da583002_35193ff5b921be7c82314@chocapic.mail>
|
1453
|
+
Subject:
|
1454
|
+
Mime-Version: 1.0
|
1455
|
+
Content-Type: text/plain;
|
1456
|
+
charset=UTF-8
|
1457
|
+
Content-Transfer-Encoding: 7bit
|
1458
|
+
|
1459
|
+
|
1460
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1461
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1462
|
+
----------------------------------------------------------------------------------------------------------
|
1463
|
+
CustomEmails::EmailTest: test_email_has_interpolation_via_liquid_on_subject,_content_text_and_content_html
|
1464
|
+
----------------------------------------------------------------------------------------------------------
|
1465
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1466
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1467
|
+
-------------------------------------------------------------------
|
1468
|
+
CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
|
1469
|
+
-------------------------------------------------------------------
|
1470
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1471
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1472
|
+
--------------------------------------------------------------------------------------------
|
1473
|
+
CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
|
1474
|
+
--------------------------------------------------------------------------------------------
|
1475
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1476
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1477
|
+
------------------------------------------------------------------------------------------
|
1478
|
+
CustomEmails::ShortMessageTest: test_Short_message_has_interpolation_via_liquid_on_content
|
1479
|
+
------------------------------------------------------------------------------------------
|
1480
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1481
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1482
|
+
------------------------------------------------------------------------------------
|
1483
|
+
CustomEmails::ShortMessageTest: test_short_message_is_scoped_to_an_messageable_model
|
1484
|
+
------------------------------------------------------------------------------------
|
1485
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1486
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1487
|
+
---------------------------------------------------------------------------------------------
|
1488
|
+
CustomEmails::ShortMessageTest: test_short_message_needs_kind,_locale_and_content_to_be_valid
|
1489
|
+
---------------------------------------------------------------------------------------------
|
1490
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1491
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1492
|
+
----------------------------
|
1493
|
+
CustomEmailsTest: test_truth
|
1494
|
+
----------------------------
|
1495
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1496
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1497
|
+
----------------------------------------------------------------------------------
|
1498
|
+
MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
|
1499
|
+
----------------------------------------------------------------------------------
|
1500
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1501
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1502
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1503
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1504
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1505
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1506
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1507
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1508
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content_text", "Good luck..."], ["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1509
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1510
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1511
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
1512
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1513
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1514
|
+
--------------------------------------------------------------------------------------
|
1515
|
+
MailerTest: test_email_interpolated_attributes_are_used_when_custom_email_to_is_called
|
1516
|
+
--------------------------------------------------------------------------------------
|
1517
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1518
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1519
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1520
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1521
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1522
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck {{ name }}..."], ["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello {{ name }}!"], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1523
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1524
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1525
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1526
|
+
|
1527
|
+
Sent mail to test@example.com (3.7ms)
|
1528
|
+
Date: Tue, 24 Dec 2013 12:19:01 +0100
|
1529
|
+
From: sender@example.org
|
1530
|
+
To: test@example.com
|
1531
|
+
Message-ID: <52b96da58fa91_35193ff5b921be7c824c0@chocapic.mail>
|
1532
|
+
Subject: Hello Luc!
|
1533
|
+
Mime-Version: 1.0
|
1534
|
+
Content-Type: text/plain;
|
1535
|
+
charset=UTF-8
|
1536
|
+
Content-Transfer-Encoding: 7bit
|
1537
|
+
|
1538
|
+
Good luck Luc...
|
1539
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1540
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
1541
|
+
-----------------------------------------------------------------------------------
|
1542
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
|
1543
|
+
-----------------------------------------------------------------------------------
|
1544
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1545
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1546
|
+
-----------------------------------------------------------------------------
|
1547
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
|
1548
|
+
-----------------------------------------------------------------------------
|
1549
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1550
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1551
|
+
--------------------------------------------------------------------------------------------
|
1552
|
+
ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
|
1553
|
+
--------------------------------------------------------------------------------------------
|
1554
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1555
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "examples" DEFAULT VALUES[0m
|
1556
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1557
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1558
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1559
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1560
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1561
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1562
|
+
[1m[35mCustomEmails::EmailKind Exists (0.0ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
|
1563
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1564
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1565
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1566
|
+
[1m[35mSQL (0.2ms)[0m 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", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1567
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1568
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1569
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Faux corps 2"], ["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1570
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1571
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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'[0m [["emailable_id", 1], ["emailable_type", "Example"]]
|
1572
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
|
1573
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1574
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1575
|
+
-----------------------------------------------------------
|
1576
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
|
1577
|
+
-----------------------------------------------------------
|
1578
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1579
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1580
|
+
-------------------------------------------------------------------------------------
|
1581
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
|
1582
|
+
-------------------------------------------------------------------------------------
|
1583
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1584
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "examples" DEFAULT VALUES
|
1585
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1586
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1587
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1588
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1589
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1590
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1591
|
+
[1m[36mCustomEmails::EmailKind Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1[0m
|
1592
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1593
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1594
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1595
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Fake body"], ["created_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1596
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1597
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1598
|
+
[1m[35mSQL (0.1ms)[0m 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", Tue, 24 Dec 2013 11:19:01 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Tue, 24 Dec 2013 11:19:01 UTC +00:00]]
|
1599
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1600
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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"]]
|
1601
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)[0m
|
1602
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1603
|
+
[1m[36m (78.0ms)[0m [1mCREATE TABLE "custom_emails_email_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
1604
|
+
[1m[35m (51.3ms)[0m CREATE UNIQUE INDEX "index_custom_emails_email_kinds_on_name" ON "custom_emails_email_kinds" ("name")
|
1605
|
+
[1m[36m (51.2ms)[0m [1mCREATE TABLE "custom_emails_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "emailable_id" integer, "emailable_type" varchar(255), "locale" varchar(255), "subject" text, "content_text" text, "content_html" text, "created_at" datetime, "updated_at" datetime, "kind_id" integer) [0m
|
1606
|
+
[1m[35m (135.2ms)[0m CREATE INDEX "index_custom_emails_emails_on_emailable_id" ON "custom_emails_emails" ("emailable_id")
|
1607
|
+
[1m[36m (51.3ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_kind_id_and_emailable_id" ON "custom_emails_emails" ("kind_id", "emailable_id")[0m
|
1608
|
+
[1m[35m (50.9ms)[0m CREATE UNIQUE INDEX "unique_w_kind_locale_and_emailable" ON "custom_emails_emails" ("kind_id", "locale", "emailable_id", "emailable_type")
|
1609
|
+
[1m[36m (59.3ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_locale" ON "custom_emails_emails" ("locale")[0m
|
1610
|
+
[1m[35m (135.2ms)[0m CREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
|
1611
|
+
[1m[36m (51.6ms)[0m [1mCREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")[0m
|
1612
|
+
[1m[35m (50.8ms)[0m CREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime)
|
1613
|
+
[1m[36m (59.7ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
1614
|
+
[1m[35m (127.5ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
1615
|
+
[1m[36m (51.2ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")[0m
|
1616
|
+
[1m[35m (50.8ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")
|
1617
|
+
[1m[36m (144.0ms)[0m [1mCREATE TABLE "examples" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) [0m
|
1618
|
+
[1m[35m (100.5ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
1619
|
+
[1m[36m (51.4ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1620
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1621
|
+
[1m[36m (51.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105500')[0m
|
1622
|
+
[1m[35m (127.3ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018164626')
|
1623
|
+
[1m[36m (51.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105400')[0m
|
1624
|
+
[1m[35m (51.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018143726')
|
1625
|
+
[1m[36m (51.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131018141445')[0m
|
1626
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1627
|
+
----------------------------------------------------------------------------------
|
1628
|
+
CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
|
1629
|
+
----------------------------------------------------------------------------------
|
1630
|
+
|
1631
|
+
Sent mail to foo@bar.org (5.4ms)
|
1632
|
+
Date: Tue, 24 Dec 2013 12:20:15 +0100
|
1633
|
+
From: sender@example.org
|
1634
|
+
To: foo@bar.org
|
1635
|
+
Message-ID: <52b96def763d8_35753ff7c77abe7c24933@chocapic.mail>
|
1636
|
+
Subject:
|
1637
|
+
Mime-Version: 1.0
|
1638
|
+
Content-Type: text/plain;
|
1639
|
+
charset=UTF-8
|
1640
|
+
Content-Transfer-Encoding: 7bit
|
1641
|
+
|
1642
|
+
|
1643
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1644
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1645
|
+
----------------------------------------------------------------------------------------------------------
|
1646
|
+
CustomEmails::EmailTest: test_email_has_interpolation_via_liquid_on_subject,_content_text_and_content_html
|
1647
|
+
----------------------------------------------------------------------------------------------------------
|
1648
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1649
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1650
|
+
-------------------------------------------------------------------
|
1651
|
+
CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
|
1652
|
+
-------------------------------------------------------------------
|
1653
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1654
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1655
|
+
--------------------------------------------------------------------------------------------
|
1656
|
+
CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
|
1657
|
+
--------------------------------------------------------------------------------------------
|
1658
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1659
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1660
|
+
------------------------------------------------------------------------------------------
|
1661
|
+
CustomEmails::ShortMessageTest: test_Short_message_has_interpolation_via_liquid_on_content
|
1662
|
+
------------------------------------------------------------------------------------------
|
1663
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1664
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1665
|
+
------------------------------------------------------------------------------------
|
1666
|
+
CustomEmails::ShortMessageTest: test_short_message_is_scoped_to_an_messageable_model
|
1667
|
+
------------------------------------------------------------------------------------
|
1668
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1669
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1670
|
+
---------------------------------------------------------------------------------------------
|
1671
|
+
CustomEmails::ShortMessageTest: test_short_message_needs_kind,_locale_and_content_to_be_valid
|
1672
|
+
---------------------------------------------------------------------------------------------
|
1673
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1674
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1675
|
+
----------------------------
|
1676
|
+
CustomEmailsTest: test_truth
|
1677
|
+
----------------------------
|
1678
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1679
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1680
|
+
----------------------------------------------------------------------------------
|
1681
|
+
MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
|
1682
|
+
----------------------------------------------------------------------------------
|
1683
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1684
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1685
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1686
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1687
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1688
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1689
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1690
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1691
|
+
[1m[36mSQL (0.3ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content_text", "Good luck..."], ["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1692
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1693
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1694
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
1695
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1696
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1697
|
+
--------------------------------------------------------------------------------------
|
1698
|
+
MailerTest: test_email_interpolated_attributes_are_used_when_custom_email_to_is_called
|
1699
|
+
--------------------------------------------------------------------------------------
|
1700
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1701
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1702
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1703
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1704
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1705
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck {{ name }}..."], ["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello {{ name }}!"], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1706
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1707
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1708
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1709
|
+
|
1710
|
+
Sent mail to test@example.com (3.6ms)
|
1711
|
+
Date: Tue, 24 Dec 2013 12:20:15 +0100
|
1712
|
+
From: sender@example.org
|
1713
|
+
To: test@example.com
|
1714
|
+
Message-ID: <52b96def830b7_35753ff7c77abe7c2505c@chocapic.mail>
|
1715
|
+
Subject: Hello Luc!
|
1716
|
+
Mime-Version: 1.0
|
1717
|
+
Content-Type: text/plain;
|
1718
|
+
charset=UTF-8
|
1719
|
+
Content-Transfer-Encoding: 7bit
|
1720
|
+
|
1721
|
+
Good luck Luc...
|
1722
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1723
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
1724
|
+
-----------------------------------------------------------------------------------
|
1725
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
|
1726
|
+
-----------------------------------------------------------------------------------
|
1727
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1728
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1729
|
+
-----------------------------------------------------------------------------
|
1730
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
|
1731
|
+
-----------------------------------------------------------------------------
|
1732
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1733
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1734
|
+
--------------------------------------------------------------------------------------------
|
1735
|
+
ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
|
1736
|
+
--------------------------------------------------------------------------------------------
|
1737
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1738
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "examples" DEFAULT VALUES[0m
|
1739
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1740
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1741
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1742
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1743
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1744
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1745
|
+
[1m[35mCustomEmails::EmailKind Exists (0.0ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
|
1746
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1747
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1748
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1749
|
+
[1m[35mSQL (0.2ms)[0m 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", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1750
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1751
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1752
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Faux corps 2"], ["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1753
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1754
|
+
[1m[36mCustomEmails::Email Load (0.2ms)[0m [1mSELECT "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'[0m [["emailable_id", 1], ["emailable_type", "Example"]]
|
1755
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
|
1756
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1757
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1758
|
+
-----------------------------------------------------------
|
1759
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
|
1760
|
+
-----------------------------------------------------------
|
1761
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1762
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1763
|
+
-------------------------------------------------------------------------------------
|
1764
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
|
1765
|
+
-------------------------------------------------------------------------------------
|
1766
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1767
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "examples" DEFAULT VALUES
|
1768
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1769
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1770
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1771
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1772
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1773
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1774
|
+
[1m[36mCustomEmails::EmailKind Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1[0m
|
1775
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1776
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1777
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1778
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Fake body"], ["created_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1779
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1780
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1781
|
+
[1m[35mSQL (0.1ms)[0m 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", Tue, 24 Dec 2013 11:20:15 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Tue, 24 Dec 2013 11:20:15 UTC +00:00]]
|
1782
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1783
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)[0m
|
1785
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1786
|
+
[1m[36m (83.0ms)[0m [1mCREATE TABLE "custom_emails_email_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
1787
|
+
[1m[35m (51.0ms)[0m CREATE UNIQUE INDEX "index_custom_emails_email_kinds_on_name" ON "custom_emails_email_kinds" ("name")
|
1788
|
+
[1m[36m (51.0ms)[0m [1mCREATE TABLE "custom_emails_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "emailable_id" integer, "emailable_type" varchar(255), "locale" varchar(255), "subject" text, "content_text" text, "content_html" text, "created_at" datetime, "updated_at" datetime, "kind_id" integer) [0m
|
1789
|
+
[1m[35m (118.7ms)[0m CREATE INDEX "index_custom_emails_emails_on_emailable_id" ON "custom_emails_emails" ("emailable_id")
|
1790
|
+
[1m[36m (51.3ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_kind_id_and_emailable_id" ON "custom_emails_emails" ("kind_id", "emailable_id")[0m
|
1791
|
+
[1m[35m (50.9ms)[0m CREATE UNIQUE INDEX "unique_w_kind_locale_and_emailable" ON "custom_emails_emails" ("kind_id", "locale", "emailable_id", "emailable_type")
|
1792
|
+
[1m[36m (50.8ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_locale" ON "custom_emails_emails" ("locale")[0m
|
1793
|
+
[1m[35m (143.3ms)[0m CREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
|
1794
|
+
[1m[36m (51.6ms)[0m [1mCREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")[0m
|
1795
|
+
[1m[35m (50.7ms)[0m CREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime)
|
1796
|
+
[1m[36m (51.4ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
1797
|
+
[1m[35m (119.3ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
1798
|
+
[1m[36m (51.1ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")[0m
|
1799
|
+
[1m[35m (50.8ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")
|
1800
|
+
[1m[36m (59.8ms)[0m [1mCREATE TABLE "examples" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) [0m
|
1801
|
+
[1m[35m (125.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
1802
|
+
[1m[36m (51.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1803
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1804
|
+
[1m[36m (51.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105500')[0m
|
1805
|
+
[1m[35m (51.4ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018164626')
|
1806
|
+
[1m[36m (152.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105400')[0m
|
1807
|
+
[1m[35m (51.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018143726')
|
1808
|
+
[1m[36m (51.5ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131018141445')[0m
|
1809
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1810
|
+
----------------------------------------------------------------------------------
|
1811
|
+
CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
|
1812
|
+
----------------------------------------------------------------------------------
|
1813
|
+
|
1814
|
+
Sent mail to foo@bar.org (5.4ms)
|
1815
|
+
Date: Tue, 24 Dec 2013 12:21:12 +0100
|
1816
|
+
From: sender@example.org
|
1817
|
+
To: foo@bar.org
|
1818
|
+
Message-ID: <52b96e2868cb0_35d03fdea069be78580cd@chocapic.mail>
|
1819
|
+
Subject:
|
1820
|
+
Mime-Version: 1.0
|
1821
|
+
Content-Type: text/plain;
|
1822
|
+
charset=UTF-8
|
1823
|
+
Content-Transfer-Encoding: 7bit
|
1824
|
+
|
1825
|
+
|
1826
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1827
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1828
|
+
----------------------------------------------------------------------------------------------------------
|
1829
|
+
CustomEmails::EmailTest: test_email_has_interpolation_via_liquid_on_subject,_content_text_and_content_html
|
1830
|
+
----------------------------------------------------------------------------------------------------------
|
1831
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1832
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1833
|
+
-------------------------------------------------------------------
|
1834
|
+
CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
|
1835
|
+
-------------------------------------------------------------------
|
1836
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1837
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1838
|
+
--------------------------------------------------------------------------------------------
|
1839
|
+
CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
|
1840
|
+
--------------------------------------------------------------------------------------------
|
1841
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1842
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1843
|
+
------------------------------------------------------------------------------------------
|
1844
|
+
CustomEmails::ShortMessageTest: test_Short_message_has_interpolation_via_liquid_on_content
|
1845
|
+
------------------------------------------------------------------------------------------
|
1846
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1847
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1848
|
+
------------------------------------------------------------------------------------
|
1849
|
+
CustomEmails::ShortMessageTest: test_short_message_is_scoped_to_an_messageable_model
|
1850
|
+
------------------------------------------------------------------------------------
|
1851
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1852
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1853
|
+
---------------------------------------------------------------------------------------------
|
1854
|
+
CustomEmails::ShortMessageTest: test_short_message_needs_kind,_locale_and_content_to_be_valid
|
1855
|
+
---------------------------------------------------------------------------------------------
|
1856
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1857
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1858
|
+
----------------------------
|
1859
|
+
CustomEmailsTest: test_truth
|
1860
|
+
----------------------------
|
1861
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1862
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1863
|
+
----------------------------------------------------------------------------------
|
1864
|
+
MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
|
1865
|
+
----------------------------------------------------------------------------------
|
1866
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1867
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1868
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1869
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1870
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1871
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1872
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1873
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1874
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content_text", "Good luck..."], ["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1875
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1876
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1877
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
1878
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1879
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1880
|
+
--------------------------------------------------------------------------------------
|
1881
|
+
MailerTest: test_email_interpolated_attributes_are_used_when_custom_email_to_is_called
|
1882
|
+
--------------------------------------------------------------------------------------
|
1883
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1884
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1885
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1886
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1887
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1888
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck {{ name }}..."], ["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello {{ name }}!"], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1889
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1890
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1891
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
1892
|
+
|
1893
|
+
Sent mail to test@example.com (28.1ms)
|
1894
|
+
Date: Tue, 24 Dec 2013 12:21:12 +0100
|
1895
|
+
From: sender@example.org
|
1896
|
+
To: test@example.com
|
1897
|
+
Message-ID: <52b96e2875ba3_35d03fdea069be7858113@chocapic.mail>
|
1898
|
+
Subject: Hello Luc!
|
1899
|
+
Mime-Version: 1.0
|
1900
|
+
Content-Type: text/plain;
|
1901
|
+
charset=UTF-8
|
1902
|
+
Content-Transfer-Encoding: 7bit
|
1903
|
+
|
1904
|
+
Good luck Luc...
|
1905
|
+
[1m[35m (0.2ms)[0m rollback transaction
|
1906
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1907
|
+
-----------------------------------------------------------------------------------
|
1908
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
|
1909
|
+
-----------------------------------------------------------------------------------
|
1910
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1911
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1912
|
+
-----------------------------------------------------------------------------
|
1913
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
|
1914
|
+
-----------------------------------------------------------------------------
|
1915
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
1916
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
1917
|
+
--------------------------------------------------------------------------------------------
|
1918
|
+
ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
|
1919
|
+
--------------------------------------------------------------------------------------------
|
1920
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1921
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "examples" DEFAULT VALUES[0m
|
1922
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1923
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1924
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
1925
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1926
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1927
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1928
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
|
1929
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1930
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1931
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1932
|
+
[1m[35mSQL (0.2ms)[0m 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", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1933
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1934
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1935
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Faux corps 2"], ["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1936
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1937
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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'[0m [["emailable_id", 1], ["emailable_type", "Example"]]
|
1938
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
|
1939
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1940
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1941
|
+
-----------------------------------------------------------
|
1942
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
|
1943
|
+
-----------------------------------------------------------
|
1944
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1945
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1946
|
+
-------------------------------------------------------------------------------------
|
1947
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
|
1948
|
+
-------------------------------------------------------------------------------------
|
1949
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1950
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "examples" DEFAULT VALUES
|
1951
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1952
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1953
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
1954
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1955
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1956
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1957
|
+
[1m[36mCustomEmails::EmailKind Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1[0m
|
1958
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1959
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1960
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
1961
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Fake body"], ["created_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1962
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
1963
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
1964
|
+
[1m[35mSQL (0.1ms)[0m 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", Tue, 24 Dec 2013 11:21:12 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Tue, 24 Dec 2013 11:21:12 UTC +00:00]]
|
1965
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1966
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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"]]
|
1967
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)[0m
|
1968
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
1969
|
+
[1m[36m (77.2ms)[0m [1mCREATE TABLE "custom_emails_email_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
1970
|
+
[1m[35m (50.9ms)[0m CREATE UNIQUE INDEX "index_custom_emails_email_kinds_on_name" ON "custom_emails_email_kinds" ("name")
|
1971
|
+
[1m[36m (125.3ms)[0m [1mCREATE TABLE "custom_emails_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "emailable_id" integer, "emailable_type" varchar(255), "locale" varchar(255), "subject" text, "content_text" text, "content_html" text, "created_at" datetime, "updated_at" datetime, "kind_id" integer) [0m
|
1972
|
+
[1m[35m (60.8ms)[0m CREATE INDEX "index_custom_emails_emails_on_emailable_id" ON "custom_emails_emails" ("emailable_id")
|
1973
|
+
[1m[36m (51.3ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_kind_id_and_emailable_id" ON "custom_emails_emails" ("kind_id", "emailable_id")[0m
|
1974
|
+
[1m[35m (50.9ms)[0m CREATE UNIQUE INDEX "unique_w_kind_locale_and_emailable" ON "custom_emails_emails" ("kind_id", "locale", "emailable_id", "emailable_type")
|
1975
|
+
[1m[36m (92.5ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_locale" ON "custom_emails_emails" ("locale")[0m
|
1976
|
+
[1m[35m (101.0ms)[0m CREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
|
1977
|
+
[1m[36m (51.7ms)[0m [1mCREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")[0m
|
1978
|
+
[1m[35m (50.7ms)[0m CREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime)
|
1979
|
+
[1m[36m (59.8ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
1980
|
+
[1m[35m (119.0ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
1981
|
+
[1m[36m (51.2ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")[0m
|
1982
|
+
[1m[35m (50.8ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")
|
1983
|
+
[1m[36m (68.1ms)[0m [1mCREATE TABLE "examples" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) [0m
|
1984
|
+
[1m[35m (133.6ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
1985
|
+
[1m[36m (51.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
1986
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
1987
|
+
[1m[36m (51.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105500')[0m
|
1988
|
+
[1m[35m (51.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018164626')
|
1989
|
+
[1m[36m (135.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105400')[0m
|
1990
|
+
[1m[35m (51.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018143726')
|
1991
|
+
[1m[36m (51.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131018141445')[0m
|
1992
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1993
|
+
----------------------------------------------------------------------------------
|
1994
|
+
CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
|
1995
|
+
----------------------------------------------------------------------------------
|
1996
|
+
|
1997
|
+
Sent mail to foo@bar.org (5.3ms)
|
1998
|
+
Date: Tue, 24 Dec 2013 12:21:49 +0100
|
1999
|
+
From: sender@example.org
|
2000
|
+
To: foo@bar.org
|
2001
|
+
Message-ID: <52b96e4d3b956_360d3f8d2e16fe7c765@chocapic.mail>
|
2002
|
+
Subject:
|
2003
|
+
Mime-Version: 1.0
|
2004
|
+
Content-Type: text/plain;
|
2005
|
+
charset=UTF-8
|
2006
|
+
Content-Transfer-Encoding: 7bit
|
2007
|
+
|
2008
|
+
|
2009
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2010
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2011
|
+
----------------------------------------------------------------------------------------------------------
|
2012
|
+
CustomEmails::EmailTest: test_email_has_interpolation_via_liquid_on_subject,_content_text_and_content_html
|
2013
|
+
----------------------------------------------------------------------------------------------------------
|
2014
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2015
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2016
|
+
-------------------------------------------------------------------
|
2017
|
+
CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
|
2018
|
+
-------------------------------------------------------------------
|
2019
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2020
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2021
|
+
--------------------------------------------------------------------------------------------
|
2022
|
+
CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
|
2023
|
+
--------------------------------------------------------------------------------------------
|
2024
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2025
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2026
|
+
------------------------------------------------------------------------------------------
|
2027
|
+
CustomEmails::ShortMessageTest: test_Short_message_has_interpolation_via_liquid_on_content
|
2028
|
+
------------------------------------------------------------------------------------------
|
2029
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2030
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2031
|
+
------------------------------------------------------------------------------------
|
2032
|
+
CustomEmails::ShortMessageTest: test_short_message_is_scoped_to_an_messageable_model
|
2033
|
+
------------------------------------------------------------------------------------
|
2034
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2035
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2036
|
+
---------------------------------------------------------------------------------------------
|
2037
|
+
CustomEmails::ShortMessageTest: test_short_message_needs_kind,_locale_and_content_to_be_valid
|
2038
|
+
---------------------------------------------------------------------------------------------
|
2039
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2040
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2041
|
+
----------------------------
|
2042
|
+
CustomEmailsTest: test_truth
|
2043
|
+
----------------------------
|
2044
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2045
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2046
|
+
----------------------------------------------------------------------------------
|
2047
|
+
MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
|
2048
|
+
----------------------------------------------------------------------------------
|
2049
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2050
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
2051
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2052
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2053
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2054
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2055
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
2056
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2057
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content_text", "Good luck..."], ["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2058
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2059
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2060
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
2061
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
2062
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2063
|
+
--------------------------------------------------------------------------------------
|
2064
|
+
MailerTest: test_email_interpolated_attributes_are_used_when_custom_email_to_is_called
|
2065
|
+
--------------------------------------------------------------------------------------
|
2066
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2067
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2068
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2069
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2070
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2071
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck {{ name }}..."], ["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello {{ name }}!"], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2072
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2073
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2074
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
2075
|
+
|
2076
|
+
Sent mail to test@example.com (3.7ms)
|
2077
|
+
Date: Tue, 24 Dec 2013 12:21:49 +0100
|
2078
|
+
From: sender@example.org
|
2079
|
+
To: test@example.com
|
2080
|
+
Message-ID: <52b96e4d4f223_360d3f8d2e16fe7c89d@chocapic.mail>
|
2081
|
+
Subject: Hello Luc!
|
2082
|
+
Mime-Version: 1.0
|
2083
|
+
Content-Type: text/plain;
|
2084
|
+
charset=UTF-8
|
2085
|
+
Content-Transfer-Encoding: 7bit
|
2086
|
+
|
2087
|
+
Good luck Luc...
|
2088
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2089
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
2090
|
+
-----------------------------------------------------------------------------------
|
2091
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
|
2092
|
+
-----------------------------------------------------------------------------------
|
2093
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
2094
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
2095
|
+
-----------------------------------------------------------------------------
|
2096
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
|
2097
|
+
-----------------------------------------------------------------------------
|
2098
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
2099
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
2100
|
+
--------------------------------------------------------------------------------------------
|
2101
|
+
ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
|
2102
|
+
--------------------------------------------------------------------------------------------
|
2103
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2104
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "examples" DEFAULT VALUES[0m
|
2105
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2106
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2107
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2108
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2109
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2110
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2111
|
+
[1m[35mCustomEmails::EmailKind Exists (0.0ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
|
2112
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2113
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2114
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2115
|
+
[1m[35mSQL (0.2ms)[0m 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", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2116
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2117
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2118
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Faux corps 2"], ["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2119
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2120
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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'[0m [["emailable_id", 1], ["emailable_type", "Example"]]
|
2121
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
|
2122
|
+
[1m[36m (0.2ms)[0m [1mrollback transaction[0m
|
2123
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2124
|
+
-----------------------------------------------------------
|
2125
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
|
2126
|
+
-----------------------------------------------------------
|
2127
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2128
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2129
|
+
-------------------------------------------------------------------------------------
|
2130
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
|
2131
|
+
-------------------------------------------------------------------------------------
|
2132
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2133
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "examples" DEFAULT VALUES
|
2134
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2135
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2136
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2137
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2138
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2139
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2140
|
+
[1m[36mCustomEmails::EmailKind Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1[0m
|
2141
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2142
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2143
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2144
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Fake body"], ["created_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2145
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2146
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2147
|
+
[1m[35mSQL (0.1ms)[0m 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", Tue, 24 Dec 2013 11:21:49 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Tue, 24 Dec 2013 11:21:49 UTC +00:00]]
|
2148
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2149
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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"]]
|
2150
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)[0m
|
2151
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2152
|
+
[1m[36m (60.5ms)[0m [1mCREATE TABLE "custom_emails_email_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
2153
|
+
[1m[35m (51.2ms)[0m CREATE UNIQUE INDEX "index_custom_emails_email_kinds_on_name" ON "custom_emails_email_kinds" ("name")
|
2154
|
+
[1m[36m (165.6ms)[0m [1mCREATE TABLE "custom_emails_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "emailable_id" integer, "emailable_type" varchar(255), "locale" varchar(255), "subject" text, "content_text" text, "content_html" text, "created_at" datetime, "updated_at" datetime, "kind_id" integer) [0m
|
2155
|
+
[1m[35m (62.1ms)[0m CREATE INDEX "index_custom_emails_emails_on_emailable_id" ON "custom_emails_emails" ("emailable_id")
|
2156
|
+
[1m[36m (51.4ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_kind_id_and_emailable_id" ON "custom_emails_emails" ("kind_id", "emailable_id")[0m
|
2157
|
+
[1m[35m (50.9ms)[0m CREATE UNIQUE INDEX "unique_w_kind_locale_and_emailable" ON "custom_emails_emails" ("kind_id", "locale", "emailable_id", "emailable_type")
|
2158
|
+
[1m[36m (92.4ms)[0m [1mCREATE INDEX "index_custom_emails_emails_on_locale" ON "custom_emails_emails" ("locale")[0m
|
2159
|
+
[1m[35m (100.9ms)[0m CREATE TABLE "custom_emails_short_message_kinds" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
|
2160
|
+
[1m[36m (51.7ms)[0m [1mCREATE UNIQUE INDEX "index_custom_emails_short_message_kinds_on_name" ON "custom_emails_short_message_kinds" ("name")[0m
|
2161
|
+
[1m[35m (50.7ms)[0m CREATE TABLE "custom_emails_short_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "messageable_id" integer, "messageable_type" varchar(255), "kind_id" integer, "locale" varchar(255), "content" text, "created_at" datetime, "updated_at" datetime)
|
2162
|
+
[1m[36m (59.8ms)[0m [1mCREATE UNIQUE INDEX "unique_w_kind_locale_and_messageable" ON "custom_emails_short_messages" ("kind_id", "locale", "messageable_id", "messageable_type")[0m
|
2163
|
+
[1m[35m (102.5ms)[0m CREATE INDEX "index_w_kind_and_messageable" ON "custom_emails_short_messages" ("kind_id", "messageable_id")
|
2164
|
+
[1m[36m (51.1ms)[0m [1mCREATE INDEX "index_custom_emails_short_messages_on_locale" ON "custom_emails_short_messages" ("locale")[0m
|
2165
|
+
[1m[35m (50.9ms)[0m CREATE INDEX "index_custom_emails_short_messages_on_messageable_id" ON "custom_emails_short_messages" ("messageable_id")
|
2166
|
+
[1m[36m (68.0ms)[0m [1mCREATE TABLE "examples" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL) [0m
|
2167
|
+
[1m[35m (109.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
2168
|
+
[1m[36m (51.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
2169
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
2170
|
+
[1m[36m (51.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105500')[0m
|
2171
|
+
[1m[35m (51.5ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018164626')
|
2172
|
+
[1m[36m (119.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131224105400')[0m
|
2173
|
+
[1m[35m (51.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20131018143726')
|
2174
|
+
[1m[36m (51.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131018141445')[0m
|
2175
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2176
|
+
----------------------------------------------------------------------------------
|
2177
|
+
CustomEmails::EmailTest: test_email_has_a_#to_method_that_produces_a_Mail::Message
|
2178
|
+
----------------------------------------------------------------------------------
|
2179
|
+
|
2180
|
+
Sent mail to foo@bar.org (5.4ms)
|
2181
|
+
Date: Tue, 24 Dec 2013 12:22:29 +0100
|
2182
|
+
From: sender@example.org
|
2183
|
+
To: foo@bar.org
|
2184
|
+
Message-ID: <52b96e75db561_36683fd54018fe84764dc@chocapic.mail>
|
2185
|
+
Subject:
|
2186
|
+
Mime-Version: 1.0
|
2187
|
+
Content-Type: text/plain;
|
2188
|
+
charset=UTF-8
|
2189
|
+
Content-Transfer-Encoding: 7bit
|
2190
|
+
|
2191
|
+
|
2192
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2193
|
+
[1m[35m (0.1ms)[0m begin transaction
|
2194
|
+
----------------------------------------------------------------------------------------------------------
|
2195
|
+
CustomEmails::EmailTest: test_email_has_interpolation_via_liquid_on_subject,_content_text_and_content_html
|
2196
|
+
----------------------------------------------------------------------------------------------------------
|
2197
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2198
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2199
|
+
-------------------------------------------------------------------
|
2200
|
+
CustomEmails::EmailTest: test_email_is_scoped_to_an_emailable_model
|
2201
|
+
-------------------------------------------------------------------
|
2202
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2203
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2204
|
+
--------------------------------------------------------------------------------------------
|
2205
|
+
CustomEmails::EmailTest: test_email_needs_kind,_locale,_subject_and_content_text_to_be_valid
|
2206
|
+
--------------------------------------------------------------------------------------------
|
2207
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2208
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2209
|
+
------------------------------------------------------------------------------------------
|
2210
|
+
CustomEmails::ShortMessageTest: test_Short_message_has_interpolation_via_liquid_on_content
|
2211
|
+
------------------------------------------------------------------------------------------
|
2212
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2213
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2214
|
+
------------------------------------------------------------------------------------
|
2215
|
+
CustomEmails::ShortMessageTest: test_short_message_is_scoped_to_an_messageable_model
|
2216
|
+
------------------------------------------------------------------------------------
|
2217
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2218
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2219
|
+
---------------------------------------------------------------------------------------------
|
2220
|
+
CustomEmails::ShortMessageTest: test_short_message_needs_kind,_locale_and_content_to_be_valid
|
2221
|
+
---------------------------------------------------------------------------------------------
|
2222
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2223
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2224
|
+
----------------------------
|
2225
|
+
CustomEmailsTest: test_truth
|
2226
|
+
----------------------------
|
2227
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2228
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2229
|
+
----------------------------------------------------------------------------------
|
2230
|
+
MailerTest: test_custom_email_to_raises_an_exception_if_there_is_no_matching_email
|
2231
|
+
----------------------------------------------------------------------------------
|
2232
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2233
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2234
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2235
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2236
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2237
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2238
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
2239
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2240
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?)[0m [["content_text", "Good luck..."], ["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["kind_id", 1], ["locale", :fr], ["subject", "Hello world!"], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2241
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2242
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2243
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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
|
2244
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2245
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2246
|
+
--------------------------------------------------------------------------------------
|
2247
|
+
MailerTest: test_email_interpolated_attributes_are_used_when_custom_email_to_is_called
|
2248
|
+
--------------------------------------------------------------------------------------
|
2249
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2250
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2251
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2252
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2253
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2254
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_emails" ("content_text", "created_at", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["content_text", "Good luck {{ name }}..."], ["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["kind_id", 1], ["locale", :en], ["subject", "Hello {{ name }}!"], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2255
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2256
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2257
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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[0m
|
2258
|
+
|
2259
|
+
Sent mail to test@example.com (3.6ms)
|
2260
|
+
Date: Tue, 24 Dec 2013 12:22:29 +0100
|
2261
|
+
From: sender@example.org
|
2262
|
+
To: test@example.com
|
2263
|
+
Message-ID: <52b96e75e827d_36683fd54018fe8476554@chocapic.mail>
|
2264
|
+
Subject: Hello Luc!
|
2265
|
+
Mime-Version: 1.0
|
2266
|
+
Content-Type: text/plain;
|
2267
|
+
charset=UTF-8
|
2268
|
+
Content-Transfer-Encoding: 7bit
|
2269
|
+
|
2270
|
+
Good luck Luc...
|
2271
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2272
|
+
[1m[36m (24.5ms)[0m [1mbegin transaction[0m
|
2273
|
+
-----------------------------------------------------------------------------------
|
2274
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_#emails_by_kind_method
|
2275
|
+
-----------------------------------------------------------------------------------
|
2276
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
2277
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
2278
|
+
-----------------------------------------------------------------------------
|
2279
|
+
ModelsTest: test_models_using_has_custom_emails_ends_with_an_:emails_relation
|
2280
|
+
-----------------------------------------------------------------------------
|
2281
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
2282
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
2283
|
+
--------------------------------------------------------------------------------------------
|
2284
|
+
ModelsTest: test_the_#emails_by_kind_method_accepts_an_optional_argument_to_filter_by_locale
|
2285
|
+
--------------------------------------------------------------------------------------------
|
2286
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2287
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "examples" DEFAULT VALUES[0m
|
2288
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2289
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2290
|
+
[1m[35mCustomEmails::EmailKind Exists (0.1ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1
|
2291
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2292
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2293
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2294
|
+
[1m[35mCustomEmails::EmailKind Exists (0.0ms)[0m SELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1
|
2295
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2296
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2297
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
2298
|
+
[1m[35mSQL (0.2ms)[0m 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", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2299
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2300
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2301
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Faux corps 2"], ["created_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :fr], ["subject", "Faux subjet 2"], ["updated_at", Tue, 24 Dec 2013 11:22:29 UTC +00:00]]
|
2302
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2303
|
+
[1m[36mCustomEmails::Email Load (0.1ms)[0m [1mSELECT "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'[0m [["emailable_id", 1], ["emailable_type", "Example"]]
|
2304
|
+
[1m[35mCustomEmails::EmailKind Load (0.1ms)[0m SELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (2)
|
2305
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
2306
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2307
|
+
-----------------------------------------------------------
|
2308
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash
|
2309
|
+
-----------------------------------------------------------
|
2310
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
2311
|
+
[1m[35m (0.0ms)[0m begin transaction
|
2312
|
+
-------------------------------------------------------------------------------------
|
2313
|
+
ModelsTest: test_the_#emails_by_kind_method_returns_an_Hash_of_emails_grouped_by_kind
|
2314
|
+
-------------------------------------------------------------------------------------
|
2315
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2316
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "examples" DEFAULT VALUES
|
2317
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2318
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2319
|
+
[1m[36mCustomEmails::EmailKind Exists (0.1ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_1' LIMIT 1[0m
|
2320
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00], ["name", :kind_1], ["updated_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00]]
|
2321
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2322
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2323
|
+
[1m[36mCustomEmails::EmailKind Exists (0.0ms)[0m [1mSELECT 1 AS one FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."name" = 'kind_2' LIMIT 1[0m
|
2324
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "custom_emails_email_kinds" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00], ["name", :kind_2], ["updated_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00]]
|
2325
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2326
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
2327
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "custom_emails_emails" ("content_text", "created_at", "emailable_id", "emailable_type", "kind_id", "locale", "subject", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?)[0m [["content_text", "Fake body"], ["created_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 1], ["locale", :en], ["subject", "Fake subject"], ["updated_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00]]
|
2328
|
+
[1m[35m (0.0ms)[0m RELEASE SAVEPOINT active_record_1
|
2329
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
2330
|
+
[1m[35mSQL (0.1ms)[0m 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", Tue, 24 Dec 2013 11:22:30 UTC +00:00], ["emailable_id", 1], ["emailable_type", "Example"], ["kind_id", 2], ["locale", :en], ["subject", "Fake subject 2"], ["updated_at", Tue, 24 Dec 2013 11:22:30 UTC +00:00]]
|
2331
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
2332
|
+
[1m[35mCustomEmails::Email Load (0.1ms)[0m 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"]]
|
2333
|
+
[1m[36mCustomEmails::EmailKind Load (0.1ms)[0m [1mSELECT "custom_emails_email_kinds".* FROM "custom_emails_email_kinds" WHERE "custom_emails_email_kinds"."id" IN (1, 2)[0m
|
2334
|
+
[1m[35m (0.1ms)[0m rollback transaction
|