rooler 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWFiZmM0MzM3OWIyNDBiODcxNjMzODU4YWVkN2ZmNDA2MDY2ZjNjZQ==
4
+ YWY3OTk5MWIwOGJlNWEyYTcxZTBkYWJmOWFmZGI5Y2NkNTA0OWI2Ng==
5
5
  data.tar.gz: !binary |-
6
- ZWViYzZhZWM0NzUzNmYxNmNlNzFmYmZiZjNlNmY4NjQ5NjZiMWUzYg==
6
+ YmIwZTNkYzk1NDVhYjA4MWQ3OTM0YTc5M2U4YTVkNWU0Y2U0ZmU4Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDcxZGVjZjk1NmQ4MDJlZDUyYWQ2MzJkYmJkMTg5YmQ1MjQ2ZjkxMmVhN2Ri
10
- NWQwNDViZWFhNjk5ZjkyMjQ3OTAyNTE3NTk1NWFhNzcxZTIwN2M2YzAxOTg5
11
- NGNkOTk5YjdlMDAxZjgwNDk2ZGE3ZmM1YjEzYjA2NTYzYjc3YzI=
9
+ ZTNkNjc1ZTM2MzUwMmZkYjYwYjVlNDA4NjEyMjI0NWM2YzUxNjFkZTY2MTRl
10
+ NDI0ZjlmYTMxZTg1Yjc5Yjk4OWFiMDVhYzc2ZjgxZTNkNGI4YmI3OGQ5NWIx
11
+ YWZlNTQ2NzAxMGNlOTI1N2UxYjc0YTM2ZTBmZDQ4MDFiNTY5ZGE=
12
12
  data.tar.gz: !binary |-
13
- ZDg2ZDUzZGQ0MTA1NGEyYmM2ODE1ZTM1YjAwZjk1YWYxMzIwMzcxZmRmNjBm
14
- ODM1NWU5MzYwYzc4Yjc2ZWExYWFmNzI5Y2U3NDg3YzZmYmNlZDZkMjMyODlh
15
- YTAzMGUwMmVmNDZlZDg3MTFlYzJkYmJlODg4OGNkMTViN2Y0MjM=
13
+ MmZiMDIyMWY4MzVmYjNhYzQ4ZDZlNzZjMzllN2I2NzRjMjEyNTNhMjQ4MTdk
14
+ M2Y1OTQ1NGU2NmM1YWY5ZDU4ZDIwMjU4YWM3NDdlZDg1N2ZlMmM1ZmQ3MTg1
15
+ ZGM2MjczOTg1MzAwYTk3MGRhNGNhNDI2MjBlYzIzMTRmOTY5Y2I=
@@ -4,6 +4,13 @@ module Rooler
4
4
  def liquidize(content, arguments)
5
5
  Liquid::Template.parse(content).render(arguments, :filters => [Rooler::LiquidFilters]).html_safe
6
6
  end
7
+
8
+ def print_tree(tree)
9
+ content_tag :ul do
10
+ content_tag :li, tree.name
11
+ tree.children { |child| print_tree(child) if child } # Child might be 'nil'
12
+ end
13
+ end
7
14
 
8
15
  end
9
16
  end
@@ -1,37 +1,44 @@
1
+ require 'rubytree'
2
+
1
3
  module Rooler
2
4
  class LiquidInspector
3
5
 
4
6
  def initialize(klass)
5
- @klass = klass.to_s.downcase
7
+ @klass = klass
8
+ @klass_name = klass.to_s.downcase
6
9
  end
7
10
 
8
11
  def tree
9
- add_liquid_methods_as_nodes(::Tree::TreeNode.new(@klass))
12
+ add_liquid_methods_as_nodes(::Tree::TreeNode.new(@klass.to_s.downcase), @klass_name)
10
13
  end
11
14
 
12
15
  private
13
16
 
14
17
  # Recursive method. Infers a class name using the name of the provided TreeNode. Creates nodes any liquid methods belonging to that class. If any of those nodes
15
18
  # are also associations, it calls itself on that node.
16
- def add_liquid_methods_as_nodes(tree)
17
- klass = tree.name.to_s.classify.constantize
19
+ def add_liquid_methods_as_nodes(tree, klass_name)
20
+ klass = klass_name.to_s.classify.constantize
18
21
  add_nodes_to_tree(tree, liquid_methods(klass))
19
- (associations(klass) & liquid_methods(klass)).each do |node|
20
- add_liquid_methods_as_nodes(tree[node])
22
+ associations(klass).each do |association|
23
+ add_liquid_methods_as_nodes(tree[association.name.to_sym], association.class_name)
21
24
  end
22
25
  return tree
23
26
  end
24
27
 
28
+ #iterate over nodes and add them to the tree. the << operator does not accept an array :(
25
29
  def add_nodes_to_tree(tree, nodes)
26
30
  nodes.each {|node| tree << ::Tree::TreeNode.new(node)}
27
31
  end
28
32
 
33
+ #get associations haveing the same name as any liquid methods
29
34
  def associations(klass)
30
- klass.reflect_on_all_associations.map(&:class_name)
35
+ liquid_methods = liquid_methods(klass)
36
+ return klass.reflect_on_all_associations.select {|k| liquid_methods.include?(k.name.to_sym)}
31
37
  end
32
38
 
39
+
33
40
  def liquid_methods(klass)
34
- klass::LiquidDropClass.public_instance_methods - Liquid::Drop.public_instance_methods
41
+ klass::LiquidDropClass.public_instance_methods.map(&:to_sym) - Liquid::Drop.public_instance_methods.map(&:to_sym)
35
42
  end
36
43
 
37
44
  end
@@ -1,3 +1,3 @@
1
1
  module Rooler
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -44318,3 +44318,3360 @@ RoolerTest: test_resets_resetable_deliveries
44318
44318
   (0.1ms) RELEASE SAVEPOINT active_record_1
44319
44319
   (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44320
44320
   (0.1ms) ROLLBACK
44321
+  (0.2ms) BEGIN
44322
+ ----------------------------------------
44323
+ Rooler::DeliveryMailerTest: test_deliver
44324
+ ----------------------------------------
44325
+  (0.2ms) SAVEPOINT active_record_1
44326
+ SQL (78.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00]]
44327
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44328
+  (0.2ms) SAVEPOINT active_record_1
44329
+ SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 241], ["updated_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00]]
44330
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44331
+  (0.3ms) SAVEPOINT active_record_1
44332
+ Rooler::Delivery Exists (24.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 217 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 217) LIMIT 1
44333
+ SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 217], ["deliverable_type", "Rooler::Rule"], ["rule_id", 217], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44334
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44335
+ Rooler::Template Load (1.2ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 217]]
44336
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (51.5ms)
44337
+
44338
+ Sent mail to test_name@to.com (57.6ms)
44339
+ Date: Fri, 28 Mar 2014 12:18:58 +0100
44340
+ From: default@myapp.com
44341
+ To: test_name@to.com
44342
+ Cc: test_name@cc.com
44343
+ Message-ID: <53355aa27b88b_1323880434ce0169cd@Yonahs-MacBook-Pro.local.mail>
44344
+ Subject: subject is: test_name
44345
+ Mime-Version: 1.0
44346
+ Content-Type: text/html;
44347
+ charset=UTF-8
44348
+ Content-Transfer-Encoding: 7bit
44349
+
44350
+ body is: test_name
44351
+  (0.4ms) ROLLBACK
44352
+  (0.2ms) BEGIN
44353
+ ---------------------------------------------------------------------------------------
44354
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
44355
+ ---------------------------------------------------------------------------------------
44356
+  (0.1ms) SAVEPOINT active_record_1
44357
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44358
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44359
+  (0.1ms) SAVEPOINT active_record_1
44360
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44361
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44362
+  (0.2ms) SAVEPOINT active_record_1
44363
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 242], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44364
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44365
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
44366
+  (0.2ms) SAVEPOINT active_record_1
44367
+ SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44368
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44369
+  (0.2ms) SAVEPOINT active_record_1
44370
+ SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 243], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44371
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44372
+  (0.2ms) ROLLBACK
44373
+  (0.2ms) BEGIN
44374
+ ------------------------------------------------------------------------------
44375
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
44376
+ ------------------------------------------------------------------------------
44377
+  (0.2ms) SAVEPOINT active_record_1
44378
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44379
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44380
+  (0.1ms) SAVEPOINT active_record_1
44381
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44382
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44383
+  (0.1ms) SAVEPOINT active_record_1
44384
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 244], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44385
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44386
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44387
+  (5.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]]
44388
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
44389
+  (1.2ms) SAVEPOINT active_record_1
44390
+ Rooler::Delivery Exists (5.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 220 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 146) LIMIT 1
44391
+ SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 146], ["deliverable_type", "Foo"], ["rule_id", 220], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44392
+  (0.5ms) RELEASE SAVEPOINT active_record_1
44393
+ SQL (1.1ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.712565' WHERE "rooler_rules"."id" = 220
44394
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
44395
+  (1.9ms) SELECT COUNT(*) FROM "rooler_deliveries"
44396
+  (4.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]]
44397
+ Foo Load (1.1ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (146))
44398
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.746418' WHERE "rooler_rules"."id" = 220
44399
+  (2.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
44400
+  (0.3ms) ROLLBACK
44401
+  (6.2ms) BEGIN
44402
+ --------------------------------------------------------------------------------------------------------
44403
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
44404
+ --------------------------------------------------------------------------------------------------------
44405
+  (0.9ms) SAVEPOINT active_record_1
44406
+ SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44407
+  (1.0ms) RELEASE SAVEPOINT active_record_1
44408
+  (2.9ms) SAVEPOINT active_record_1
44409
+ SQL (3.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44410
+  (1.2ms) RELEASE SAVEPOINT active_record_1
44411
+  (3.7ms) SAVEPOINT active_record_1
44412
+ SQL (4.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44413
+  (1.1ms) RELEASE SAVEPOINT active_record_1
44414
+  (0.2ms) SAVEPOINT active_record_1
44415
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 245], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44416
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44417
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1
44418
+  (0.2ms) ROLLBACK
44419
+  (0.2ms) BEGIN
44420
+ --------------------------------------------------------------------------------------------------------------------------------------
44421
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
44422
+ --------------------------------------------------------------------------------------------------------------------------------------
44423
+  (0.2ms) SAVEPOINT active_record_1
44424
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44425
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44426
+  (0.2ms) SAVEPOINT active_record_1
44427
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44428
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44429
+  (0.1ms) SAVEPOINT active_record_1
44430
+ SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 246], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44431
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44432
+  (0.2ms) SAVEPOINT active_record_1
44433
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44434
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44435
+  (0.2ms) SAVEPOINT active_record_1
44436
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 247], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44437
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44438
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]]
44439
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
44440
+  (0.2ms) SAVEPOINT active_record_1
44441
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 222 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1
44442
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 222], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44443
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44444
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.894200' WHERE "rooler_rules"."id" = 222
44445
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
44446
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 223]]
44447
+  (0.2ms) SAVEPOINT active_record_1
44448
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 223 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1
44449
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 223], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44450
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44451
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.904883' WHERE "rooler_rules"."id" = 223
44452
+  (0.1ms) SAVEPOINT active_record_1
44453
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44454
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44455
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 222]]
44456
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]]
44457
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (149))
44458
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 223]]
44459
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
44460
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 223]]
44461
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 223]]
44462
+  (0.2ms) ROLLBACK
44463
+  (0.3ms) BEGIN
44464
+ ----------------------------------------------------------------------------------------------------
44465
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
44466
+ ----------------------------------------------------------------------------------------------------
44467
+  (0.2ms) SAVEPOINT active_record_1
44468
+ SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44469
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44470
+  (0.2ms) SAVEPOINT active_record_1
44471
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44472
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44473
+  (0.1ms) SAVEPOINT active_record_1
44474
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 248], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44475
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44476
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]]
44477
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
44478
+  (0.2ms) SAVEPOINT active_record_1
44479
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 224 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1
44480
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Foo"], ["rule_id", 224], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44481
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44482
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.948269' WHERE "rooler_rules"."id" = 224
44483
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]]
44484
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (151))
44485
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
44486
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]]
44487
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (151))
44488
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.953878' WHERE "rooler_rules"."id" = 224
44489
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
44490
+  (0.1ms) SAVEPOINT active_record_1
44491
+ SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 151 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44492
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44493
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44494
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]]
44495
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
44496
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (151) [["rule_id", 224]]
44497
+  (0.2ms) SAVEPOINT active_record_1
44498
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 113]]
44499
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44500
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44501
+  (0.1ms) SAVEPOINT active_record_1
44502
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 151 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44503
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44504
+  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"
44505
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]]
44506
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
44507
+  (0.2ms) SAVEPOINT active_record_1
44508
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 224 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1
44509
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Foo"], ["rule_id", 224], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44510
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44511
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.981345' WHERE "rooler_rules"."id" = 224
44512
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44513
+  (0.2ms) ROLLBACK
44514
+  (0.2ms) BEGIN
44515
+ -------------------------------------------------------------------------------------------------------------------------
44516
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
44517
+ -------------------------------------------------------------------------------------------------------------------------
44518
+  (0.2ms) SAVEPOINT active_record_1
44519
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44520
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44521
+  (0.1ms) SAVEPOINT active_record_1
44522
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:09:58 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 249], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44523
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44524
+  (0.1ms) SAVEPOINT active_record_1
44525
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]
44526
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44527
+  (0.1ms) SAVEPOINT active_record_1
44528
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:07:58 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 250], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44529
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44530
+  (0.1ms) SAVEPOINT active_record_1
44531
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44532
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44533
+  (0.2ms) SAVEPOINT active_record_1
44534
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 251], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44535
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44536
+  (0.2ms) SAVEPOINT active_record_1
44537
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44538
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44539
+  (0.1ms) SAVEPOINT active_record_1
44540
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 252], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44541
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44542
+ Rooler::Rule Load (1.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
44543
+  (0.2ms) ROLLBACK
44544
+  (0.2ms) BEGIN
44545
+ ---------------------------------------------------------------------------------------
44546
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
44547
+ ---------------------------------------------------------------------------------------
44548
+  (0.2ms) SAVEPOINT active_record_1
44549
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44550
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44551
+  (0.1ms) SAVEPOINT active_record_1
44552
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
44553
+  (0.2ms) SAVEPOINT active_record_1
44554
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44555
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44556
+  (0.1ms) SAVEPOINT active_record_1
44557
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
44558
+  (0.2ms) ROLLBACK
44559
+  (0.2ms) BEGIN
44560
+ --------------------------------------------------------------------------
44561
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
44562
+ --------------------------------------------------------------------------
44563
+  (0.4ms) SAVEPOINT active_record_1
44564
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44565
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44566
+  (0.2ms) SAVEPOINT active_record_1
44567
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 255], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44568
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44569
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 255]]
44570
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
44571
+  (0.1ms) SAVEPOINT active_record_1
44572
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44573
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44574
+  (0.1ms) SAVEPOINT active_record_1
44575
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44576
+  (0.4ms) RELEASE SAVEPOINT active_record_1
44577
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
44578
+  (0.3ms) ROLLBACK
44579
+  (0.2ms) BEGIN
44580
+ ----------------------------------------------------------------------------------
44581
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
44582
+ ----------------------------------------------------------------------------------
44583
+  (0.2ms) SAVEPOINT active_record_1
44584
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44585
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44586
+  (0.1ms) SAVEPOINT active_record_1
44587
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 256], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44588
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44589
+  (0.1ms) SAVEPOINT active_record_1
44590
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44591
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44592
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 256]]
44593
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
44594
+  (0.2ms) ROLLBACK
44595
+  (0.1ms) BEGIN
44596
+ ----------------------------------------
44597
+ RoolerTest: test_delivers_pending_emails
44598
+ ----------------------------------------
44599
+  (0.2ms) SAVEPOINT active_record_1
44600
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44601
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44602
+  (0.1ms) SAVEPOINT active_record_1
44603
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 257], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44604
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44605
+  (0.2ms) SAVEPOINT active_record_1
44606
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44607
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44608
+  (0.1ms) SAVEPOINT active_record_1
44609
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 258], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44610
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44611
+  (0.1ms) SAVEPOINT active_record_1
44612
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 231 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 232) LIMIT 1
44613
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["deliverable_id", 232], ["deliverable_type", "Rooler::Rule"], ["rule_id", 231], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44614
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44615
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
44616
+ Rooler::Template Load (0.7ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 231]]
44617
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 232]]
44618
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
44619
+
44620
+ Sent mail to test@email.com (18.1ms)
44621
+ Date: Fri, 28 Mar 2014 12:18:59 +0100
44622
+ From: default@myapp.com
44623
+ To: test@email.com
44624
+ Message-ID: <53355aa36ec09_1323880434ce01705b@Yonahs-MacBook-Pro.local.mail>
44625
+ Subject: subject-16
44626
+ Mime-Version: 1.0
44627
+ Content-Type: text/html;
44628
+ charset=UTF-8
44629
+ Content-Transfer-Encoding: 7bit
44630
+
44631
+ body-16
44632
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:18:59.467529' WHERE "rooler_deliveries"."id" = 115
44633
+ Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 115]]
44634
+  (0.3ms) ROLLBACK
44635
+  (0.2ms) BEGIN
44636
+ ------------------------------------------
44637
+ RoolerTest: test_processes_scheduled_rules
44638
+ ------------------------------------------
44639
+  (0.1ms) SAVEPOINT active_record_1
44640
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44641
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44642
+  (0.1ms) SAVEPOINT active_record_1
44643
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44644
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44645
+  (0.1ms) SAVEPOINT active_record_1
44646
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 259], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44647
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44648
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
44649
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
44650
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 233]]
44651
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
44652
+  (0.2ms) SAVEPOINT active_record_1
44653
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 233 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 155) LIMIT 1
44654
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["deliverable_id", 155], ["deliverable_type", "Foo"], ["rule_id", 233], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44655
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44656
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:59.494097' WHERE "rooler_rules"."id" = 233
44657
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44658
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
44659
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 155]]
44660
+  (0.2ms) ROLLBACK
44661
+  (0.2ms) BEGIN
44662
+ --------------------------------------------
44663
+ RoolerTest: test_resets_resetable_deliveries
44664
+ --------------------------------------------
44665
+  (0.2ms) SAVEPOINT active_record_1
44666
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44667
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44668
+  (0.2ms) SAVEPOINT active_record_1
44669
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44670
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44671
+  (0.2ms) SAVEPOINT active_record_1
44672
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 260], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44673
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44674
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 234]]
44675
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
44676
+  (0.2ms) SAVEPOINT active_record_1
44677
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 234 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 156) LIMIT 1
44678
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["deliverable_id", 156], ["deliverable_type", "Foo"], ["rule_id", 234], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44679
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44680
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:59.521909' WHERE "rooler_rules"."id" = 234
44681
+  (0.1ms) SAVEPOINT active_record_1
44682
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 156 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]
44683
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44684
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
44685
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
44686
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 234]]
44687
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
44688
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (156) [["rule_id", 234]]
44689
+  (0.1ms) SAVEPOINT active_record_1
44690
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 117]]
44691
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44692
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
44693
+  (0.1ms) ROLLBACK
44694
+  (0.2ms) BEGIN
44695
+ ----------------------------------------
44696
+ Rooler::DeliveryMailerTest: test_deliver
44697
+ ----------------------------------------
44698
+  (0.3ms) SAVEPOINT active_record_1
44699
+ SQL (23.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00]]
44700
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44701
+  (0.2ms) SAVEPOINT active_record_1
44702
+ SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 261], ["updated_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00]]
44703
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44704
+  (0.2ms) SAVEPOINT active_record_1
44705
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 235 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1
44706
+ SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Rooler::Rule"], ["rule_id", 235], ["updated_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00]]
44707
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44708
+ Rooler::Template Load (1.3ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 235]]
44709
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.3ms)
44710
+
44711
+ Sent mail to test_name@to.com (28.5ms)
44712
+ Date: Fri, 28 Mar 2014 12:43:55 +0100
44713
+ From: default@myapp.com
44714
+ To: test_name@to.com
44715
+ Cc: test_name@cc.com
44716
+ Message-ID: <5335607b21ac9_139963fd09c834cd895711@Yonahs-MacBook-Pro.local.mail>
44717
+ Subject: subject is: test_name
44718
+ Mime-Version: 1.0
44719
+ Content-Type: text/html;
44720
+ charset=UTF-8
44721
+ Content-Transfer-Encoding: 7bit
44722
+
44723
+ body is: test_name
44724
+  (0.3ms) ROLLBACK
44725
+  (0.2ms) BEGIN
44726
+ ---------------------------------------------------------------------------------------
44727
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
44728
+ ---------------------------------------------------------------------------------------
44729
+  (0.1ms) SAVEPOINT active_record_1
44730
+ SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44731
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44732
+  (0.1ms) SAVEPOINT active_record_1
44733
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44734
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44735
+  (0.2ms) SAVEPOINT active_record_1
44736
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 262], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44737
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44738
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
44739
+  (0.3ms) SAVEPOINT active_record_1
44740
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44741
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44742
+  (0.1ms) SAVEPOINT active_record_1
44743
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 263], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44744
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44745
+  (0.2ms) ROLLBACK
44746
+  (0.1ms) BEGIN
44747
+ ------------------------------------------------------------------------------
44748
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
44749
+ ------------------------------------------------------------------------------
44750
+  (0.1ms) SAVEPOINT active_record_1
44751
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44752
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44753
+  (0.1ms) SAVEPOINT active_record_1
44754
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44755
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44756
+  (0.2ms) SAVEPOINT active_record_1
44757
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 264], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44758
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44759
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44760
+  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]]
44761
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
44762
+  (0.1ms) SAVEPOINT active_record_1
44763
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 238 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1
44764
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Foo"], ["rule_id", 238], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44765
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44766
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.239650' WHERE "rooler_rules"."id" = 238
44767
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
44768
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44769
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]]
44770
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (158))
44771
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.245531' WHERE "rooler_rules"."id" = 238
44772
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44773
+  (0.2ms) ROLLBACK
44774
+  (0.1ms) BEGIN
44775
+ --------------------------------------------------------------------------------------------------------
44776
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
44777
+ --------------------------------------------------------------------------------------------------------
44778
+  (0.1ms) SAVEPOINT active_record_1
44779
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44780
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44781
+  (0.1ms) SAVEPOINT active_record_1
44782
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44783
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44784
+  (0.2ms) SAVEPOINT active_record_1
44785
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44786
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44787
+  (0.2ms) SAVEPOINT active_record_1
44788
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 265], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44789
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44790
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1
44791
+  (0.2ms) ROLLBACK
44792
+  (0.2ms) BEGIN
44793
+ --------------------------------------------------------------------------------------------------------------------------------------
44794
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
44795
+ --------------------------------------------------------------------------------------------------------------------------------------
44796
+  (0.1ms) SAVEPOINT active_record_1
44797
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44798
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44799
+  (0.2ms) SAVEPOINT active_record_1
44800
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44801
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44802
+  (0.1ms) SAVEPOINT active_record_1
44803
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 266], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44804
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44805
+  (0.3ms) SAVEPOINT active_record_1
44806
+ SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44807
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44808
+  (0.1ms) SAVEPOINT active_record_1
44809
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 267], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44810
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44811
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 240]]
44812
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
44813
+  (0.1ms) SAVEPOINT active_record_1
44814
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 240 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 161) LIMIT 1
44815
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 161], ["deliverable_type", "Foo"], ["rule_id", 240], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44816
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44817
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.322129' WHERE "rooler_rules"."id" = 240
44818
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
44819
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 241]]
44820
+  (0.1ms) SAVEPOINT active_record_1
44821
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 241 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 161) LIMIT 1
44822
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 161], ["deliverable_type", "Foo"], ["rule_id", 241], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44823
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44824
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.330357' WHERE "rooler_rules"."id" = 241
44825
+  (0.1ms) SAVEPOINT active_record_1
44826
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44827
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44828
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 240]]
44829
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 240]]
44830
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (161))
44831
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 241]]
44832
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
44833
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 241]]
44834
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 241]]
44835
+  (0.2ms) ROLLBACK
44836
+  (0.1ms) BEGIN
44837
+ ----------------------------------------------------------------------------------------------------
44838
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
44839
+ ----------------------------------------------------------------------------------------------------
44840
+  (0.1ms) SAVEPOINT active_record_1
44841
+ SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44842
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44843
+  (0.1ms) SAVEPOINT active_record_1
44844
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44845
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44846
+  (0.2ms) SAVEPOINT active_record_1
44847
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 268], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44848
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44849
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]]
44850
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
44851
+  (0.1ms) SAVEPOINT active_record_1
44852
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1
44853
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Foo"], ["rule_id", 242], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44854
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44855
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.364610' WHERE "rooler_rules"."id" = 242
44856
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]]
44857
+  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (163))
44858
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
44859
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]]
44860
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (163))
44861
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.373855' WHERE "rooler_rules"."id" = 242
44862
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44863
+  (0.1ms) SAVEPOINT active_record_1
44864
+ SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 163 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44865
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44866
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44867
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]]
44868
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
44869
+ Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (163) [["rule_id", 242]]
44870
+  (0.3ms) SAVEPOINT active_record_1
44871
+ SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 122]]
44872
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44873
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
44874
+  (0.2ms) SAVEPOINT active_record_1
44875
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 163 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44876
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44877
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44878
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]]
44879
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
44880
+  (0.1ms) SAVEPOINT active_record_1
44881
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1
44882
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Foo"], ["rule_id", 242], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44883
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44884
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.402911' WHERE "rooler_rules"."id" = 242
44885
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
44886
+  (0.2ms) ROLLBACK
44887
+  (0.1ms) BEGIN
44888
+ -------------------------------------------------------------------------------------------------------------------------
44889
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
44890
+ -------------------------------------------------------------------------------------------------------------------------
44891
+  (0.2ms) SAVEPOINT active_record_1
44892
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44893
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44894
+  (0.1ms) SAVEPOINT active_record_1
44895
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:34:55 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 269], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44896
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44897
+  (0.2ms) SAVEPOINT active_record_1
44898
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44899
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44900
+  (0.1ms) SAVEPOINT active_record_1
44901
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:32:55 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 270], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44902
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44903
+  (0.2ms) SAVEPOINT active_record_1
44904
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44905
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44906
+  (0.1ms) SAVEPOINT active_record_1
44907
+ SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 271], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44908
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44909
+  (0.2ms) SAVEPOINT active_record_1
44910
+ SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44911
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44912
+  (0.1ms) SAVEPOINT active_record_1
44913
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 272], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44914
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44915
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
44916
+  (0.2ms) ROLLBACK
44917
+  (0.2ms) BEGIN
44918
+ ---------------------------------------------------------------------------------------
44919
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
44920
+ ---------------------------------------------------------------------------------------
44921
+  (0.1ms) SAVEPOINT active_record_1
44922
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44923
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44924
+  (0.2ms) SAVEPOINT active_record_1
44925
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
44926
+  (0.2ms) SAVEPOINT active_record_1
44927
+ SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44928
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44929
+  (0.2ms) SAVEPOINT active_record_1
44930
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
44931
+  (0.2ms) ROLLBACK
44932
+  (0.1ms) BEGIN
44933
+ --------------------------------------------------------------------------
44934
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
44935
+ --------------------------------------------------------------------------
44936
+  (0.1ms) SAVEPOINT active_record_1
44937
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44938
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44939
+  (0.1ms) SAVEPOINT active_record_1
44940
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 275], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44941
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44942
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 275]]
44943
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
44944
+  (0.1ms) SAVEPOINT active_record_1
44945
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44946
+  (0.1ms) RELEASE SAVEPOINT active_record_1
44947
+  (0.1ms) SAVEPOINT active_record_1
44948
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44949
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44950
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
44951
+  (0.2ms) ROLLBACK
44952
+  (0.2ms) BEGIN
44953
+ ----------------------------------------------------------------------------------
44954
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
44955
+ ----------------------------------------------------------------------------------
44956
+  (0.2ms) SAVEPOINT active_record_1
44957
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44958
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44959
+  (0.1ms) SAVEPOINT active_record_1
44960
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 276], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44961
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44962
+  (0.1ms) SAVEPOINT active_record_1
44963
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44964
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44965
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 276]]
44966
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
44967
+  (0.5ms) ROLLBACK
44968
+  (0.2ms) BEGIN
44969
+ ----------------------------------------
44970
+ RoolerTest: test_delivers_pending_emails
44971
+ ----------------------------------------
44972
+  (0.2ms) SAVEPOINT active_record_1
44973
+ SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44974
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44975
+  (1.0ms) SAVEPOINT active_record_1
44976
+ SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 277], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44977
+  (0.7ms) RELEASE SAVEPOINT active_record_1
44978
+  (0.2ms) SAVEPOINT active_record_1
44979
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44980
+  (0.3ms) RELEASE SAVEPOINT active_record_1
44981
+  (0.4ms) SAVEPOINT active_record_1
44982
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 278], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44983
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44984
+  (0.1ms) SAVEPOINT active_record_1
44985
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 249 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 250) LIMIT 1
44986
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 250], ["deliverable_type", "Rooler::Rule"], ["rule_id", 249], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
44987
+  (0.2ms) RELEASE SAVEPOINT active_record_1
44988
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
44989
+ Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 249]]
44990
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 250]]
44991
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.9ms)
44992
+
44993
+ Sent mail to test@email.com (23.4ms)
44994
+ Date: Fri, 28 Mar 2014 12:43:55 +0100
44995
+ From: default@myapp.com
44996
+ To: test@email.com
44997
+ Message-ID: <5335607be012c_139963fd09c834cd8958b9@Yonahs-MacBook-Pro.local.mail>
44998
+ Subject: subject-16
44999
+ Mime-Version: 1.0
45000
+ Content-Type: text/html;
45001
+ charset=UTF-8
45002
+ Content-Transfer-Encoding: 7bit
45003
+
45004
+ body-16
45005
+ SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:43:55.938742' WHERE "rooler_deliveries"."id" = 124
45006
+ Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 124]]
45007
+  (0.3ms) ROLLBACK
45008
+  (0.2ms) BEGIN
45009
+ ------------------------------------------
45010
+ RoolerTest: test_processes_scheduled_rules
45011
+ ------------------------------------------
45012
+  (0.2ms) SAVEPOINT active_record_1
45013
+ SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
45014
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45015
+  (0.3ms) SAVEPOINT active_record_1
45016
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
45017
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45018
+  (0.3ms) SAVEPOINT active_record_1
45019
+ SQL (2.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 279], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
45020
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45021
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
45022
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
45023
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 251]]
45024
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45025
+  (0.2ms) SAVEPOINT active_record_1
45026
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 251 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1
45027
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Foo"], ["rule_id", 251], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]
45028
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45029
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.988099' WHERE "rooler_rules"."id" = 251
45030
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
45031
+ Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
45032
+ Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 167]]
45033
+  (0.2ms) ROLLBACK
45034
+  (0.1ms) BEGIN
45035
+ --------------------------------------------
45036
+ RoolerTest: test_resets_resetable_deliveries
45037
+ --------------------------------------------
45038
+  (0.1ms) SAVEPOINT active_record_1
45039
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]
45040
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45041
+  (0.8ms) SAVEPOINT active_record_1
45042
+ SQL (2.1ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]
45043
+  (0.9ms) RELEASE SAVEPOINT active_record_1
45044
+  (0.2ms) SAVEPOINT active_record_1
45045
+ SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 280], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]
45046
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45047
+  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 252]]
45048
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45049
+  (0.2ms) SAVEPOINT active_record_1
45050
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 252 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 168) LIMIT 1
45051
+ SQL (1.0ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["deliverable_id", 168], ["deliverable_type", "Foo"], ["rule_id", 252], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]
45052
+  (1.0ms) RELEASE SAVEPOINT active_record_1
45053
+ SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:56.037789' WHERE "rooler_rules"."id" = 252
45054
+  (0.5ms) SAVEPOINT active_record_1
45055
+ SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 168 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]
45056
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45057
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45058
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"
45059
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 252]]
45060
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
45061
+ Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (168) [["rule_id", 252]]
45062
+  (0.2ms) SAVEPOINT active_record_1
45063
+ SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 126]]
45064
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45065
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
45066
+  (0.3ms) ROLLBACK
45067
+  (0.1ms) BEGIN
45068
+ ----------------------------------------
45069
+ Rooler::DeliveryMailerTest: test_deliver
45070
+ ----------------------------------------
45071
+  (0.2ms) SAVEPOINT active_record_1
45072
+ SQL (8.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45073
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45074
+  (0.2ms) SAVEPOINT active_record_1
45075
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 281], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45076
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45077
+  (0.2ms) SAVEPOINT active_record_1
45078
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 253 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 253) LIMIT 1
45079
+ SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 253], ["deliverable_type", "Rooler::Rule"], ["rule_id", 253], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45080
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45081
+ Rooler::Template Load (1.2ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 253]]
45082
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.5ms)
45083
+
45084
+ Sent mail to test_name@to.com (25.9ms)
45085
+ Date: Fri, 28 Mar 2014 12:45:46 +0100
45086
+ From: default@myapp.com
45087
+ To: test_name@to.com
45088
+ Cc: test_name@cc.com
45089
+ Message-ID: <533560ea73aeb_13a183fe430434cd060757@Yonahs-MacBook-Pro.local.mail>
45090
+ Subject: subject is: test_name
45091
+ Mime-Version: 1.0
45092
+ Content-Type: text/html;
45093
+ charset=UTF-8
45094
+ Content-Transfer-Encoding: 7bit
45095
+
45096
+ body is: test_name
45097
+  (0.3ms) ROLLBACK
45098
+  (0.1ms) BEGIN
45099
+ ---------------------------------------------------------------------------------------
45100
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
45101
+ ---------------------------------------------------------------------------------------
45102
+  (0.1ms) SAVEPOINT active_record_1
45103
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45104
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45105
+  (0.1ms) SAVEPOINT active_record_1
45106
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45107
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45108
+  (0.1ms) SAVEPOINT active_record_1
45109
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 282], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45110
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45111
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
45112
+  (0.2ms) SAVEPOINT active_record_1
45113
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45114
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45115
+  (0.1ms) SAVEPOINT active_record_1
45116
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 283], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45117
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45118
+  (0.2ms) ROLLBACK
45119
+  (0.1ms) BEGIN
45120
+ ------------------------------------------------------------------------------
45121
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
45122
+ ------------------------------------------------------------------------------
45123
+  (0.1ms) SAVEPOINT active_record_1
45124
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45125
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45126
+  (0.1ms) SAVEPOINT active_record_1
45127
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45128
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45129
+  (0.1ms) SAVEPOINT active_record_1
45130
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 284], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45131
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45132
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45133
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]]
45134
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45135
+  (0.2ms) SAVEPOINT active_record_1
45136
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 256 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 170) LIMIT 1
45137
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 170], ["deliverable_type", "Foo"], ["rule_id", 256], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45138
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45139
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.558663' WHERE "rooler_rules"."id" = 256
45140
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45141
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45142
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]]
45143
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (170))
45144
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.563517' WHERE "rooler_rules"."id" = 256
45145
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45146
+  (0.1ms) ROLLBACK
45147
+  (0.1ms) BEGIN
45148
+ --------------------------------------------------------------------------------------------------------
45149
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
45150
+ --------------------------------------------------------------------------------------------------------
45151
+  (0.1ms) SAVEPOINT active_record_1
45152
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45153
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45154
+  (0.1ms) SAVEPOINT active_record_1
45155
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45156
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45157
+  (0.1ms) SAVEPOINT active_record_1
45158
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45159
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45160
+  (0.3ms) SAVEPOINT active_record_1
45161
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 285], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45162
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45163
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
45164
+  (0.1ms) ROLLBACK
45165
+  (0.2ms) BEGIN
45166
+ --------------------------------------------------------------------------------------------------------------------------------------
45167
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
45168
+ --------------------------------------------------------------------------------------------------------------------------------------
45169
+  (0.1ms) SAVEPOINT active_record_1
45170
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45171
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45172
+  (0.1ms) SAVEPOINT active_record_1
45173
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45174
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45175
+  (0.1ms) SAVEPOINT active_record_1
45176
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 286], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45177
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45178
+  (0.2ms) SAVEPOINT active_record_1
45179
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45180
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45181
+  (0.1ms) SAVEPOINT active_record_1
45182
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 287], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45183
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45184
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 258]]
45185
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45186
+  (0.2ms) SAVEPOINT active_record_1
45187
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 258 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1
45188
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Foo"], ["rule_id", 258], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45189
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45190
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.611199' WHERE "rooler_rules"."id" = 258
45191
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
45192
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 259]]
45193
+  (0.1ms) SAVEPOINT active_record_1
45194
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 259 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1
45195
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Foo"], ["rule_id", 259], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45196
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45197
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.618573' WHERE "rooler_rules"."id" = 259
45198
+  (0.1ms) SAVEPOINT active_record_1
45199
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45200
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45201
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 258]]
45202
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 258]]
45203
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (173))
45204
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 259]]
45205
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
45206
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 259]]
45207
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 259]]
45208
+  (0.1ms) ROLLBACK
45209
+  (0.1ms) BEGIN
45210
+ ----------------------------------------------------------------------------------------------------
45211
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
45212
+ ----------------------------------------------------------------------------------------------------
45213
+  (0.1ms) SAVEPOINT active_record_1
45214
+ SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45215
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45216
+  (0.2ms) SAVEPOINT active_record_1
45217
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45218
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45219
+  (0.1ms) SAVEPOINT active_record_1
45220
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 288], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45221
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45222
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]]
45223
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45224
+  (0.1ms) SAVEPOINT active_record_1
45225
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 260 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 175) LIMIT 1
45226
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 175], ["deliverable_type", "Foo"], ["rule_id", 260], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45227
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45228
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.649687' WHERE "rooler_rules"."id" = 260
45229
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]]
45230
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (175))
45231
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45232
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]]
45233
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (175))
45234
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.655407' WHERE "rooler_rules"."id" = 260
45235
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45236
+  (0.1ms) SAVEPOINT active_record_1
45237
+ SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 175 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45238
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45239
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45240
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]]
45241
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
45242
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (175) [["rule_id", 260]]
45243
+  (0.2ms) SAVEPOINT active_record_1
45244
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 131]]
45245
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45246
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45247
+  (0.1ms) SAVEPOINT active_record_1
45248
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 175 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45249
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45250
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45251
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]]
45252
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45253
+  (0.1ms) SAVEPOINT active_record_1
45254
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 260 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 175) LIMIT 1
45255
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 175], ["deliverable_type", "Foo"], ["rule_id", 260], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45256
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45257
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.679990' WHERE "rooler_rules"."id" = 260
45258
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45259
+  (0.2ms) ROLLBACK
45260
+  (0.1ms) BEGIN
45261
+ -------------------------------------------------------------------------------------------------------------------------
45262
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
45263
+ -------------------------------------------------------------------------------------------------------------------------
45264
+  (0.1ms) SAVEPOINT active_record_1
45265
+ SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45266
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45267
+  (0.1ms) SAVEPOINT active_record_1
45268
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:36:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 289], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45269
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45270
+  (0.1ms) SAVEPOINT active_record_1
45271
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45272
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45273
+  (0.1ms) SAVEPOINT active_record_1
45274
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:34:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 290], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45275
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45276
+  (0.1ms) SAVEPOINT active_record_1
45277
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45278
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45279
+  (0.1ms) SAVEPOINT active_record_1
45280
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 291], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45281
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45282
+  (0.1ms) SAVEPOINT active_record_1
45283
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45284
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45285
+  (0.1ms) SAVEPOINT active_record_1
45286
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 292], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45287
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45288
+ Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
45289
+  (0.2ms) ROLLBACK
45290
+  (0.1ms) BEGIN
45291
+ ---------------------------------------------------------------------------------------
45292
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
45293
+ ---------------------------------------------------------------------------------------
45294
+  (0.2ms) SAVEPOINT active_record_1
45295
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45296
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45297
+  (0.1ms) SAVEPOINT active_record_1
45298
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
45299
+  (0.2ms) SAVEPOINT active_record_1
45300
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45301
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45302
+  (0.1ms) SAVEPOINT active_record_1
45303
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
45304
+  (0.1ms) ROLLBACK
45305
+  (0.1ms) BEGIN
45306
+ --------------------------------------------------------------------------
45307
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
45308
+ --------------------------------------------------------------------------
45309
+  (0.1ms) SAVEPOINT active_record_1
45310
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45311
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45312
+  (0.2ms) SAVEPOINT active_record_1
45313
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 295], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45314
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45315
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 295]]
45316
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
45317
+  (0.1ms) SAVEPOINT active_record_1
45318
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45319
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45320
+  (0.1ms) SAVEPOINT active_record_1
45321
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45322
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45323
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
45324
+  (0.2ms) ROLLBACK
45325
+  (0.2ms) BEGIN
45326
+ ----------------------------------------------------------------------------------
45327
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
45328
+ ----------------------------------------------------------------------------------
45329
+  (0.2ms) SAVEPOINT active_record_1
45330
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45331
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45332
+  (0.3ms) SAVEPOINT active_record_1
45333
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 296], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45334
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45335
+  (0.2ms) SAVEPOINT active_record_1
45336
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45337
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45338
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 296]]
45339
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
45340
+  (0.2ms) ROLLBACK
45341
+  (0.1ms) BEGIN
45342
+ ----------------------------------------
45343
+ RoolerTest: test_delivers_pending_emails
45344
+ ----------------------------------------
45345
+  (0.2ms) SAVEPOINT active_record_1
45346
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45347
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45348
+  (0.1ms) SAVEPOINT active_record_1
45349
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 297], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45350
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45351
+  (0.1ms) SAVEPOINT active_record_1
45352
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45353
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45354
+  (0.1ms) SAVEPOINT active_record_1
45355
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 298], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45356
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45357
+  (0.1ms) SAVEPOINT active_record_1
45358
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 267 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 268) LIMIT 1
45359
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 268], ["deliverable_type", "Rooler::Rule"], ["rule_id", 267], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45360
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45361
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
45362
+ Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 267]]
45363
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 268]]
45364
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms)
45365
+
45366
+ Sent mail to test@email.com (13.8ms)
45367
+ Date: Fri, 28 Mar 2014 12:45:46 +0100
45368
+ From: default@myapp.com
45369
+ To: test@email.com
45370
+ Message-ID: <533560eade25c_13a183fe430434cd060866@Yonahs-MacBook-Pro.local.mail>
45371
+ Subject: subject-16
45372
+ Mime-Version: 1.0
45373
+ Content-Type: text/html;
45374
+ charset=UTF-8
45375
+ Content-Transfer-Encoding: 7bit
45376
+
45377
+ body-16
45378
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:45:46.921996' WHERE "rooler_deliveries"."id" = 133
45379
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 133]]
45380
+  (0.2ms) ROLLBACK
45381
+  (0.1ms) BEGIN
45382
+ ------------------------------------------
45383
+ RoolerTest: test_processes_scheduled_rules
45384
+ ------------------------------------------
45385
+  (0.1ms) SAVEPOINT active_record_1
45386
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45387
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45388
+  (0.1ms) SAVEPOINT active_record_1
45389
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45390
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45391
+  (0.1ms) SAVEPOINT active_record_1
45392
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 299], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45393
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45394
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45395
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
45396
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]]
45397
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45398
+  (0.2ms) SAVEPOINT active_record_1
45399
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 269 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 179) LIMIT 1
45400
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 179], ["deliverable_type", "Foo"], ["rule_id", 269], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45401
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45402
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.946704' WHERE "rooler_rules"."id" = 269
45403
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45404
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
45405
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 179]]
45406
+  (0.2ms) ROLLBACK
45407
+  (0.1ms) BEGIN
45408
+ --------------------------------------------
45409
+ RoolerTest: test_resets_resetable_deliveries
45410
+ --------------------------------------------
45411
+  (0.1ms) SAVEPOINT active_record_1
45412
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45413
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45414
+  (0.1ms) SAVEPOINT active_record_1
45415
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45416
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45417
+  (0.1ms) SAVEPOINT active_record_1
45418
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 300], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45419
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45420
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]]
45421
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45422
+  (0.1ms) SAVEPOINT active_record_1
45423
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 270 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 180) LIMIT 1
45424
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 180], ["deliverable_type", "Foo"], ["rule_id", 270], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45425
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45426
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.970670' WHERE "rooler_rules"."id" = 270
45427
+  (0.1ms) SAVEPOINT active_record_1
45428
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 180 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]
45429
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45430
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45431
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
45432
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]]
45433
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
45434
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (180) [["rule_id", 270]]
45435
+  (0.1ms) SAVEPOINT active_record_1
45436
+ SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 135]]
45437
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45438
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45439
+  (0.1ms) ROLLBACK
45440
+  (0.1ms) BEGIN
45441
+ ----------------------------------------
45442
+ Rooler::DeliveryMailerTest: test_deliver
45443
+ ----------------------------------------
45444
+  (0.2ms) SAVEPOINT active_record_1
45445
+ SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45446
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45447
+  (0.2ms) SAVEPOINT active_record_1
45448
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 301], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45449
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45450
+  (0.2ms) SAVEPOINT active_record_1
45451
+ Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 271 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 271) LIMIT 1
45452
+ SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 271], ["deliverable_type", "Rooler::Rule"], ["rule_id", 271], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45453
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45454
+ Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 271]]
45455
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.5ms)
45456
+
45457
+ Sent mail to test_name@to.com (25.5ms)
45458
+ Date: Fri, 28 Mar 2014 12:47:46 +0100
45459
+ From: default@myapp.com
45460
+ To: test_name@to.com
45461
+ Cc: test_name@cc.com
45462
+ Message-ID: <5335616269c8d_13a9d3fc685434cd04003@Yonahs-MacBook-Pro.local.mail>
45463
+ Subject: subject is: test_name
45464
+ Mime-Version: 1.0
45465
+ Content-Type: text/html;
45466
+ charset=UTF-8
45467
+ Content-Transfer-Encoding: 7bit
45468
+
45469
+ body is: test_name
45470
+  (0.2ms) ROLLBACK
45471
+  (0.2ms) BEGIN
45472
+ ---------------------------------------------------------------------------------------
45473
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
45474
+ ---------------------------------------------------------------------------------------
45475
+  (0.2ms) SAVEPOINT active_record_1
45476
+ SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45477
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45478
+  (0.1ms) SAVEPOINT active_record_1
45479
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45480
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45481
+  (0.1ms) SAVEPOINT active_record_1
45482
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 302], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45483
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45484
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
45485
+  (0.1ms) SAVEPOINT active_record_1
45486
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45487
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45488
+  (0.1ms) SAVEPOINT active_record_1
45489
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 303], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45490
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45491
+  (0.2ms) ROLLBACK
45492
+  (0.1ms) BEGIN
45493
+ ------------------------------------------------------------------------------
45494
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
45495
+ ------------------------------------------------------------------------------
45496
+  (0.1ms) SAVEPOINT active_record_1
45497
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45498
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45499
+  (0.1ms) SAVEPOINT active_record_1
45500
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45501
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45502
+  (0.1ms) SAVEPOINT active_record_1
45503
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 304], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45504
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45505
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45506
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 274]]
45507
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45508
+  (0.1ms) SAVEPOINT active_record_1
45509
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 274 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 182) LIMIT 1
45510
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 182], ["deliverable_type", "Foo"], ["rule_id", 274], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45511
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45512
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.519217' WHERE "rooler_rules"."id" = 274
45513
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45514
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45515
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 274]]
45516
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (182))
45517
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.523870' WHERE "rooler_rules"."id" = 274
45518
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45519
+  (0.1ms) ROLLBACK
45520
+  (0.1ms) BEGIN
45521
+ --------------------------------------------------------------------------------------------------------
45522
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
45523
+ --------------------------------------------------------------------------------------------------------
45524
+  (0.1ms) SAVEPOINT active_record_1
45525
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45526
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45527
+  (0.1ms) SAVEPOINT active_record_1
45528
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45529
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45530
+  (0.1ms) SAVEPOINT active_record_1
45531
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45532
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45533
+  (0.1ms) SAVEPOINT active_record_1
45534
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 305], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45535
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45536
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
45537
+  (0.2ms) ROLLBACK
45538
+  (0.1ms) BEGIN
45539
+ --------------------------------------------------------------------------------------------------------------------------------------
45540
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
45541
+ --------------------------------------------------------------------------------------------------------------------------------------
45542
+  (0.1ms) SAVEPOINT active_record_1
45543
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45544
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45545
+  (0.1ms) SAVEPOINT active_record_1
45546
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45547
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45548
+  (0.1ms) SAVEPOINT active_record_1
45549
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 306], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45550
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45551
+  (0.1ms) SAVEPOINT active_record_1
45552
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45553
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45554
+  (0.1ms) SAVEPOINT active_record_1
45555
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 307], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45556
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45557
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 276]]
45558
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45559
+  (0.1ms) SAVEPOINT active_record_1
45560
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 276 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1
45561
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 276], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45562
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45563
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.567332' WHERE "rooler_rules"."id" = 276
45564
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
45565
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 277]]
45566
+  (0.1ms) SAVEPOINT active_record_1
45567
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 277 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1
45568
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 277], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45569
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45570
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.574426' WHERE "rooler_rules"."id" = 277
45571
+  (0.1ms) SAVEPOINT active_record_1
45572
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45573
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45574
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 276]]
45575
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 276]]
45576
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (185))
45577
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 277]]
45578
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
45579
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 277]]
45580
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 277]]
45581
+  (0.2ms) ROLLBACK
45582
+  (0.2ms) BEGIN
45583
+ ----------------------------------------------------------------------------------------------------
45584
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
45585
+ ----------------------------------------------------------------------------------------------------
45586
+  (0.1ms) SAVEPOINT active_record_1
45587
+ SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45588
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45589
+  (0.2ms) SAVEPOINT active_record_1
45590
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45591
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45592
+  (0.1ms) SAVEPOINT active_record_1
45593
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 308], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45594
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45595
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]]
45596
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45597
+  (0.1ms) SAVEPOINT active_record_1
45598
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 187) LIMIT 1
45599
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 187], ["deliverable_type", "Foo"], ["rule_id", 278], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45600
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45601
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.606902' WHERE "rooler_rules"."id" = 278
45602
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]]
45603
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (187))
45604
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45605
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]]
45606
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (187))
45607
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.612331' WHERE "rooler_rules"."id" = 278
45608
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45609
+  (0.1ms) SAVEPOINT active_record_1
45610
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 187 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45611
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45612
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45613
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]]
45614
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
45615
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (187) [["rule_id", 278]]
45616
+  (0.2ms) SAVEPOINT active_record_1
45617
+ SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 140]]
45618
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45619
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45620
+  (0.2ms) SAVEPOINT active_record_1
45621
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 187 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45622
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45623
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
45624
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]]
45625
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45626
+  (0.1ms) SAVEPOINT active_record_1
45627
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 187) LIMIT 1
45628
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 187], ["deliverable_type", "Foo"], ["rule_id", 278], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45629
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45630
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.642335' WHERE "rooler_rules"."id" = 278
45631
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45632
+  (0.2ms) ROLLBACK
45633
+  (0.1ms) BEGIN
45634
+ -------------------------------------------------------------------------------------------------------------------------
45635
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
45636
+ -------------------------------------------------------------------------------------------------------------------------
45637
+  (0.2ms) SAVEPOINT active_record_1
45638
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45639
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45640
+  (0.1ms) SAVEPOINT active_record_1
45641
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:38:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 309], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45642
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45643
+  (0.1ms) SAVEPOINT active_record_1
45644
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45645
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45646
+  (0.1ms) SAVEPOINT active_record_1
45647
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:36:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 310], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45648
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45649
+  (0.1ms) SAVEPOINT active_record_1
45650
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45651
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45652
+  (0.1ms) SAVEPOINT active_record_1
45653
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 311], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45654
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45655
+  (0.1ms) SAVEPOINT active_record_1
45656
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45657
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45658
+  (0.1ms) SAVEPOINT active_record_1
45659
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 312], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45660
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45661
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
45662
+  (0.1ms) ROLLBACK
45663
+  (0.2ms) BEGIN
45664
+ ---------------------------------------------------------------------------------------
45665
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
45666
+ ---------------------------------------------------------------------------------------
45667
+  (0.2ms) SAVEPOINT active_record_1
45668
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45669
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45670
+  (0.1ms) SAVEPOINT active_record_1
45671
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
45672
+  (0.1ms) SAVEPOINT active_record_1
45673
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45674
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45675
+  (0.1ms) SAVEPOINT active_record_1
45676
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
45677
+  (0.2ms) ROLLBACK
45678
+  (0.1ms) BEGIN
45679
+ --------------------------------------------------------------------------
45680
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
45681
+ --------------------------------------------------------------------------
45682
+  (0.1ms) SAVEPOINT active_record_1
45683
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45684
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45685
+  (0.1ms) SAVEPOINT active_record_1
45686
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 315], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45687
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45688
+ Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 315]]
45689
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
45690
+  (0.2ms) SAVEPOINT active_record_1
45691
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45692
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45693
+  (0.1ms) SAVEPOINT active_record_1
45694
+ SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45695
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45696
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
45697
+  (0.2ms) ROLLBACK
45698
+  (0.1ms) BEGIN
45699
+ ----------------------------------------------------------------------------------
45700
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
45701
+ ----------------------------------------------------------------------------------
45702
+  (0.1ms) SAVEPOINT active_record_1
45703
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45704
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45705
+  (0.1ms) SAVEPOINT active_record_1
45706
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 316], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45707
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45708
+  (0.1ms) SAVEPOINT active_record_1
45709
+ SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45710
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45711
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 316]]
45712
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
45713
+  (0.2ms) ROLLBACK
45714
+  (0.1ms) BEGIN
45715
+ ----------------------------------------
45716
+ RoolerTest: test_delivers_pending_emails
45717
+ ----------------------------------------
45718
+  (0.1ms) SAVEPOINT active_record_1
45719
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45720
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45721
+  (0.1ms) SAVEPOINT active_record_1
45722
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 317], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45723
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45724
+  (0.1ms) SAVEPOINT active_record_1
45725
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45726
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45727
+  (0.2ms) SAVEPOINT active_record_1
45728
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 318], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45729
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45730
+  (0.1ms) SAVEPOINT active_record_1
45731
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 285 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 286) LIMIT 1
45732
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 286], ["deliverable_type", "Rooler::Rule"], ["rule_id", 285], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45733
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45734
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
45735
+ Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 285]]
45736
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 286]]
45737
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
45738
+
45739
+ Sent mail to test@email.com (13.1ms)
45740
+ Date: Fri, 28 Mar 2014 12:47:46 +0100
45741
+ From: default@myapp.com
45742
+ To: test@email.com
45743
+ Message-ID: <53356162ccb52_13a9d3fc685434cd040188@Yonahs-MacBook-Pro.local.mail>
45744
+ Subject: subject-16
45745
+ Mime-Version: 1.0
45746
+ Content-Type: text/html;
45747
+ charset=UTF-8
45748
+ Content-Transfer-Encoding: 7bit
45749
+
45750
+ body-16
45751
+ SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:47:46.850027' WHERE "rooler_deliveries"."id" = 142
45752
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 142]]
45753
+  (0.2ms) ROLLBACK
45754
+  (0.1ms) BEGIN
45755
+ ------------------------------------------
45756
+ RoolerTest: test_processes_scheduled_rules
45757
+ ------------------------------------------
45758
+  (0.1ms) SAVEPOINT active_record_1
45759
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45760
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45761
+  (0.2ms) SAVEPOINT active_record_1
45762
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45763
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45764
+  (0.2ms) SAVEPOINT active_record_1
45765
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 319], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45766
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45767
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
45768
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
45769
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]]
45770
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45771
+  (0.1ms) SAVEPOINT active_record_1
45772
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 287 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 191) LIMIT 1
45773
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 191], ["deliverable_type", "Foo"], ["rule_id", 287], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45774
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45775
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.875440' WHERE "rooler_rules"."id" = 287
45776
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45777
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
45778
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 191]]
45779
+  (0.2ms) ROLLBACK
45780
+  (0.1ms) BEGIN
45781
+ --------------------------------------------
45782
+ RoolerTest: test_resets_resetable_deliveries
45783
+ --------------------------------------------
45784
+  (0.2ms) SAVEPOINT active_record_1
45785
+ SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45786
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45787
+  (0.1ms) SAVEPOINT active_record_1
45788
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45789
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45790
+  (0.1ms) SAVEPOINT active_record_1
45791
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 320], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45792
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45793
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 288]]
45794
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45795
+  (0.1ms) SAVEPOINT active_record_1
45796
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 288 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 192) LIMIT 1
45797
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 192], ["deliverable_type", "Foo"], ["rule_id", 288], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45798
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45799
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.899568' WHERE "rooler_rules"."id" = 288
45800
+  (0.2ms) SAVEPOINT active_record_1
45801
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 192 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]
45802
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45803
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45804
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
45805
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 288]]
45806
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
45807
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (192) [["rule_id", 288]]
45808
+  (0.2ms) SAVEPOINT active_record_1
45809
+ SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 144]]
45810
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45811
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45812
+  (0.1ms) ROLLBACK
45813
+  (0.2ms) BEGIN
45814
+ ----------------------------------------
45815
+ Rooler::DeliveryMailerTest: test_deliver
45816
+ ----------------------------------------
45817
+  (0.2ms) SAVEPOINT active_record_1
45818
+ SQL (6.4ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]
45819
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45820
+  (0.2ms) SAVEPOINT active_record_1
45821
+ SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 321], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]
45822
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45823
+  (0.2ms) SAVEPOINT active_record_1
45824
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 289 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 289) LIMIT 1
45825
+ SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["deliverable_id", 289], ["deliverable_type", "Rooler::Rule"], ["rule_id", 289], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]
45826
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45827
+ Rooler::Template Load (1.2ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 289]]
45828
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (57.3ms)
45829
+
45830
+ Sent mail to test_name@to.com (36.5ms)
45831
+ Date: Fri, 28 Mar 2014 12:48:14 +0100
45832
+ From: default@myapp.com
45833
+ To: test_name@to.com
45834
+ Cc: test_name@cc.com
45835
+ Message-ID: <5335617ee7d74_13ac23fc645834cd0906bd@Yonahs-MacBook-Pro.local.mail>
45836
+ Subject: subject is: test_name
45837
+ Mime-Version: 1.0
45838
+ Content-Type: text/html;
45839
+ charset=UTF-8
45840
+ Content-Transfer-Encoding: 7bit
45841
+
45842
+ body is: test_name
45843
+  (0.3ms) ROLLBACK
45844
+  (0.2ms) BEGIN
45845
+ ---------------------------------------------------------------------------------------
45846
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
45847
+ ---------------------------------------------------------------------------------------
45848
+  (0.2ms) SAVEPOINT active_record_1
45849
+ SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]
45850
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45851
+  (0.2ms) SAVEPOINT active_record_1
45852
+ SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]
45853
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45854
+  (0.2ms) SAVEPOINT active_record_1
45855
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 322], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45856
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45857
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')
45858
+  (0.2ms) SAVEPOINT active_record_1
45859
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45860
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45861
+  (0.2ms) SAVEPOINT active_record_1
45862
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 323], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45863
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45864
+  (0.2ms) ROLLBACK
45865
+  (0.2ms) BEGIN
45866
+ ------------------------------------------------------------------------------
45867
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
45868
+ ------------------------------------------------------------------------------
45869
+  (0.2ms) SAVEPOINT active_record_1
45870
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45871
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45872
+  (0.2ms) SAVEPOINT active_record_1
45873
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45874
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45875
+  (0.3ms) SAVEPOINT active_record_1
45876
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 324], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45877
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45878
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
45879
+  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 292]]
45880
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45881
+  (0.2ms) SAVEPOINT active_record_1
45882
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 292 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 194) LIMIT 1
45883
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 194], ["deliverable_type", "Foo"], ["rule_id", 292], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45884
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45885
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.059458' WHERE "rooler_rules"."id" = 292
45886
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45887
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45888
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 292]]
45889
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (194))
45890
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.063979' WHERE "rooler_rules"."id" = 292
45891
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
45892
+  (0.2ms) ROLLBACK
45893
+  (0.2ms) BEGIN
45894
+ --------------------------------------------------------------------------------------------------------
45895
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
45896
+ --------------------------------------------------------------------------------------------------------
45897
+  (0.1ms) SAVEPOINT active_record_1
45898
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45899
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45900
+  (0.1ms) SAVEPOINT active_record_1
45901
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45902
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45903
+  (0.1ms) SAVEPOINT active_record_1
45904
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45905
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45906
+  (0.1ms) SAVEPOINT active_record_1
45907
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 325], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45908
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45909
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
45910
+  (0.2ms) ROLLBACK
45911
+  (0.1ms) BEGIN
45912
+ --------------------------------------------------------------------------------------------------------------------------------------
45913
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
45914
+ --------------------------------------------------------------------------------------------------------------------------------------
45915
+  (0.1ms) SAVEPOINT active_record_1
45916
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45917
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45918
+  (0.1ms) SAVEPOINT active_record_1
45919
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45920
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45921
+  (0.1ms) SAVEPOINT active_record_1
45922
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 326], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45923
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45924
+  (0.1ms) SAVEPOINT active_record_1
45925
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45926
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45927
+  (0.1ms) SAVEPOINT active_record_1
45928
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 327], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45929
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45930
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 294]]
45931
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
45932
+  (0.1ms) SAVEPOINT active_record_1
45933
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 294 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1
45934
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Foo"], ["rule_id", 294], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45935
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45936
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.108104' WHERE "rooler_rules"."id" = 294
45937
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
45938
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]]
45939
+  (0.1ms) SAVEPOINT active_record_1
45940
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 295 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1
45941
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Foo"], ["rule_id", 295], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45942
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45943
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.115331' WHERE "rooler_rules"."id" = 295
45944
+  (0.2ms) SAVEPOINT active_record_1
45945
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45946
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45947
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 294]]
45948
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 294]]
45949
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (197))
45950
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 295]]
45951
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
45952
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]]
45953
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]]
45954
+  (0.2ms) ROLLBACK
45955
+  (0.2ms) BEGIN
45956
+ ----------------------------------------------------------------------------------------------------
45957
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
45958
+ ----------------------------------------------------------------------------------------------------
45959
+  (0.1ms) SAVEPOINT active_record_1
45960
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45961
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45962
+  (0.1ms) SAVEPOINT active_record_1
45963
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45964
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45965
+  (0.1ms) SAVEPOINT active_record_1
45966
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 328], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45967
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45968
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]]
45969
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45970
+  (0.1ms) SAVEPOINT active_record_1
45971
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 296 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1
45972
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Foo"], ["rule_id", 296], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45973
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45974
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.146946' WHERE "rooler_rules"."id" = 296
45975
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]]
45976
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (199))
45977
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45978
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]]
45979
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (199))
45980
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.153330' WHERE "rooler_rules"."id" = 296
45981
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45982
+  (0.1ms) SAVEPOINT active_record_1
45983
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 199 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45984
+  (0.1ms) RELEASE SAVEPOINT active_record_1
45985
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45986
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]]
45987
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
45988
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (199) [["rule_id", 296]]
45989
+  (0.2ms) SAVEPOINT active_record_1
45990
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 149]]
45991
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45992
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
45993
+  (0.1ms) SAVEPOINT active_record_1
45994
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 199 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
45995
+  (0.2ms) RELEASE SAVEPOINT active_record_1
45996
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
45997
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]]
45998
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
45999
+  (0.1ms) SAVEPOINT active_record_1
46000
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 296 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1
46001
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Foo"], ["rule_id", 296], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46002
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46003
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.177289' WHERE "rooler_rules"."id" = 296
46004
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46005
+  (0.1ms) ROLLBACK
46006
+  (0.1ms) BEGIN
46007
+ -------------------------------------------------------------------------------------------------------------------------
46008
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
46009
+ -------------------------------------------------------------------------------------------------------------------------
46010
+  (0.2ms) SAVEPOINT active_record_1
46011
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46012
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46013
+  (0.1ms) SAVEPOINT active_record_1
46014
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:39:15 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 329], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46015
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46016
+  (0.1ms) SAVEPOINT active_record_1
46017
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46018
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46019
+  (0.1ms) SAVEPOINT active_record_1
46020
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:37:15 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 330], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46021
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46022
+  (0.1ms) SAVEPOINT active_record_1
46023
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46024
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46025
+  (0.1ms) SAVEPOINT active_record_1
46026
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 331], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46027
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46028
+  (0.1ms) SAVEPOINT active_record_1
46029
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46030
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46031
+  (0.3ms) SAVEPOINT active_record_1
46032
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 332], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46033
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46034
+ Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
46035
+  (0.3ms) ROLLBACK
46036
+  (0.2ms) BEGIN
46037
+ ---------------------------------------------------------------------------------------
46038
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
46039
+ ---------------------------------------------------------------------------------------
46040
+  (0.2ms) SAVEPOINT active_record_1
46041
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46042
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46043
+  (0.2ms) SAVEPOINT active_record_1
46044
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
46045
+  (0.1ms) SAVEPOINT active_record_1
46046
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46047
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46048
+  (0.1ms) SAVEPOINT active_record_1
46049
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
46050
+  (0.2ms) ROLLBACK
46051
+  (0.1ms) BEGIN
46052
+ --------------------------------------------------------------------------
46053
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
46054
+ --------------------------------------------------------------------------
46055
+  (0.1ms) SAVEPOINT active_record_1
46056
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46057
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46058
+  (0.1ms) SAVEPOINT active_record_1
46059
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 335], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46060
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46061
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 335]]
46062
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46063
+  (0.1ms) SAVEPOINT active_record_1
46064
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46065
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46066
+  (0.2ms) SAVEPOINT active_record_1
46067
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46068
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46069
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46070
+  (0.2ms) ROLLBACK
46071
+  (0.1ms) BEGIN
46072
+ ----------------------------------------------------------------------------------
46073
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
46074
+ ----------------------------------------------------------------------------------
46075
+  (0.1ms) SAVEPOINT active_record_1
46076
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46077
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46078
+  (0.1ms) SAVEPOINT active_record_1
46079
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 336], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46080
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46081
+  (0.1ms) SAVEPOINT active_record_1
46082
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46083
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46084
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 336]]
46085
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46086
+  (0.2ms) ROLLBACK
46087
+  (0.2ms) BEGIN
46088
+ ----------------------------------------
46089
+ RoolerTest: test_delivers_pending_emails
46090
+ ----------------------------------------
46091
+  (0.2ms) SAVEPOINT active_record_1
46092
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46093
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46094
+  (0.1ms) SAVEPOINT active_record_1
46095
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 337], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46096
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46097
+  (0.2ms) SAVEPOINT active_record_1
46098
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46099
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46100
+  (0.1ms) SAVEPOINT active_record_1
46101
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 338], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46102
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46103
+  (0.1ms) SAVEPOINT active_record_1
46104
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 303 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 304) LIMIT 1
46105
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 304], ["deliverable_type", "Rooler::Rule"], ["rule_id", 303], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46106
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46107
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
46108
+ Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 303]]
46109
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 304]]
46110
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
46111
+
46112
+ Sent mail to test@email.com (13.2ms)
46113
+ Date: Fri, 28 Mar 2014 12:48:15 +0100
46114
+ From: default@myapp.com
46115
+ To: test@email.com
46116
+ Message-ID: <5335617f632ee_13ac23fc645834cd09073@Yonahs-MacBook-Pro.local.mail>
46117
+ Subject: subject-16
46118
+ Mime-Version: 1.0
46119
+ Content-Type: text/html;
46120
+ charset=UTF-8
46121
+ Content-Transfer-Encoding: 7bit
46122
+
46123
+ body-16
46124
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:48:15.417760' WHERE "rooler_deliveries"."id" = 151
46125
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 151]]
46126
+  (0.2ms) ROLLBACK
46127
+  (0.1ms) BEGIN
46128
+ ------------------------------------------
46129
+ RoolerTest: test_processes_scheduled_rules
46130
+ ------------------------------------------
46131
+  (0.1ms) SAVEPOINT active_record_1
46132
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46133
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46134
+  (0.1ms) SAVEPOINT active_record_1
46135
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46136
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46137
+  (0.1ms) SAVEPOINT active_record_1
46138
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 339], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46139
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46140
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46141
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
46142
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 305]]
46143
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46144
+  (0.1ms) SAVEPOINT active_record_1
46145
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 305 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 203) LIMIT 1
46146
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 203], ["deliverable_type", "Foo"], ["rule_id", 305], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46147
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46148
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.442186' WHERE "rooler_rules"."id" = 305
46149
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46150
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
46151
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 203]]
46152
+  (0.2ms) ROLLBACK
46153
+  (0.1ms) BEGIN
46154
+ --------------------------------------------
46155
+ RoolerTest: test_resets_resetable_deliveries
46156
+ --------------------------------------------
46157
+  (0.1ms) SAVEPOINT active_record_1
46158
+ SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46159
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46160
+  (0.1ms) SAVEPOINT active_record_1
46161
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46162
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46163
+  (0.1ms) SAVEPOINT active_record_1
46164
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 340], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46166
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 306]]
46167
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46168
+  (0.1ms) SAVEPOINT active_record_1
46169
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 306 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 204) LIMIT 1
46170
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 204], ["deliverable_type", "Foo"], ["rule_id", 306], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46171
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46172
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.465862' WHERE "rooler_rules"."id" = 306
46173
+  (0.1ms) SAVEPOINT active_record_1
46174
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 204 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]
46175
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46176
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46177
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
46178
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 306]]
46179
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
46180
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (204) [["rule_id", 306]]
46181
+  (0.2ms) SAVEPOINT active_record_1
46182
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 153]]
46183
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46184
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46185
+  (0.1ms) ROLLBACK
46186
+  (0.2ms) BEGIN
46187
+ ----------------------------------------
46188
+ Rooler::DeliveryMailerTest: test_deliver
46189
+ ----------------------------------------
46190
+  (0.2ms) SAVEPOINT active_record_1
46191
+ SQL (8.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46192
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46193
+  (0.2ms) SAVEPOINT active_record_1
46194
+ SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 341], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46195
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46196
+  (0.2ms) SAVEPOINT active_record_1
46197
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 307 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 307) LIMIT 1
46198
+ SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 307], ["deliverable_type", "Rooler::Rule"], ["rule_id", 307], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46199
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46200
+ Rooler::Template Load (1.3ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 307]]
46201
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.7ms)
46202
+
46203
+ Sent mail to test_name@to.com (27.1ms)
46204
+ Date: Fri, 28 Mar 2014 12:52:18 +0100
46205
+ From: default@myapp.com
46206
+ To: test_name@to.com
46207
+ Cc: test_name@cc.com
46208
+ Message-ID: <53356272a40ab_13be83fc471434cdc24073@Yonahs-MacBook-Pro.local.mail>
46209
+ Subject: subject is: test_name
46210
+ Mime-Version: 1.0
46211
+ Content-Type: text/html;
46212
+ charset=UTF-8
46213
+ Content-Transfer-Encoding: 7bit
46214
+
46215
+ body is: test_name
46216
+  (0.3ms) ROLLBACK
46217
+  (0.2ms) BEGIN
46218
+ ---------------------------------------------------------------------------------------
46219
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
46220
+ ---------------------------------------------------------------------------------------
46221
+  (0.1ms) SAVEPOINT active_record_1
46222
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46223
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46224
+  (0.1ms) SAVEPOINT active_record_1
46225
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46226
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46227
+  (0.1ms) SAVEPOINT active_record_1
46228
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 342], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46229
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46230
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
46231
+  (0.2ms) SAVEPOINT active_record_1
46232
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46233
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46234
+  (0.1ms) SAVEPOINT active_record_1
46235
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 343], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46236
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46237
+  (0.2ms) ROLLBACK
46238
+  (0.1ms) BEGIN
46239
+ ------------------------------------------------------------------------------
46240
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
46241
+ ------------------------------------------------------------------------------
46242
+  (0.1ms) SAVEPOINT active_record_1
46243
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46244
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46245
+  (0.1ms) SAVEPOINT active_record_1
46246
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46247
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46248
+  (0.1ms) SAVEPOINT active_record_1
46249
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 344], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46250
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46251
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46252
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 310]]
46253
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46254
+  (0.1ms) SAVEPOINT active_record_1
46255
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 310 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1
46256
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 206], ["deliverable_type", "Foo"], ["rule_id", 310], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46257
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46258
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.756519' WHERE "rooler_rules"."id" = 310
46259
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46260
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46261
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 310]]
46262
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (206))
46263
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.761257' WHERE "rooler_rules"."id" = 310
46264
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46265
+  (0.1ms) ROLLBACK
46266
+  (0.1ms) BEGIN
46267
+ --------------------------------------------------------------------------------------------------------
46268
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
46269
+ --------------------------------------------------------------------------------------------------------
46270
+  (0.1ms) SAVEPOINT active_record_1
46271
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46272
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46273
+  (0.1ms) SAVEPOINT active_record_1
46274
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46275
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46276
+  (0.1ms) SAVEPOINT active_record_1
46277
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46278
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46279
+  (0.1ms) SAVEPOINT active_record_1
46280
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 345], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46281
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46282
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
46283
+  (0.1ms) ROLLBACK
46284
+  (0.1ms) BEGIN
46285
+ --------------------------------------------------------------------------------------------------------------------------------------
46286
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
46287
+ --------------------------------------------------------------------------------------------------------------------------------------
46288
+  (0.1ms) SAVEPOINT active_record_1
46289
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46290
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46291
+  (0.2ms) SAVEPOINT active_record_1
46292
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46293
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46294
+  (0.1ms) SAVEPOINT active_record_1
46295
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 346], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46296
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46297
+  (0.1ms) SAVEPOINT active_record_1
46298
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46299
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46300
+  (0.1ms) SAVEPOINT active_record_1
46301
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 347], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46302
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46303
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 312]]
46304
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46305
+  (0.1ms) SAVEPOINT active_record_1
46306
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 312 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 209) LIMIT 1
46307
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 209], ["deliverable_type", "Foo"], ["rule_id", 312], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46308
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46309
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.813687' WHERE "rooler_rules"."id" = 312
46310
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
46311
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]
46312
+  (0.1ms) SAVEPOINT active_record_1
46313
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 313 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 209) LIMIT 1
46314
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 209], ["deliverable_type", "Foo"], ["rule_id", 313], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46315
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46316
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.820824' WHERE "rooler_rules"."id" = 313
46317
+  (0.1ms) SAVEPOINT active_record_1
46318
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46319
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46320
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 312]]
46321
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 312]]
46322
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (209))
46323
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]]
46324
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
46325
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]
46326
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]
46327
+  (0.1ms) ROLLBACK
46328
+  (0.1ms) BEGIN
46329
+ ----------------------------------------------------------------------------------------------------
46330
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
46331
+ ----------------------------------------------------------------------------------------------------
46332
+  (0.1ms) SAVEPOINT active_record_1
46333
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46334
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46335
+  (0.1ms) SAVEPOINT active_record_1
46336
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46337
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46338
+  (0.1ms) SAVEPOINT active_record_1
46339
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 348], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46340
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46341
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]
46342
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46343
+  (0.1ms) SAVEPOINT active_record_1
46344
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 314 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1
46345
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Foo"], ["rule_id", 314], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46346
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46347
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.850552' WHERE "rooler_rules"."id" = 314
46348
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]
46349
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (211))
46350
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46351
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]
46352
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (211))
46353
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.855949' WHERE "rooler_rules"."id" = 314
46354
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46355
+  (0.1ms) SAVEPOINT active_record_1
46356
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 211 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46357
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46358
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46359
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]
46360
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
46361
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (211) [["rule_id", 314]]
46362
+  (0.2ms) SAVEPOINT active_record_1
46363
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 158]]
46364
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46365
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46366
+  (0.1ms) SAVEPOINT active_record_1
46367
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 211 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46368
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46369
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46370
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]
46371
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46372
+  (0.3ms) SAVEPOINT active_record_1
46373
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 314 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1
46374
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Foo"], ["rule_id", 314], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46375
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46376
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.881769' WHERE "rooler_rules"."id" = 314
46377
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46378
+  (0.2ms) ROLLBACK
46379
+  (0.1ms) BEGIN
46380
+ -------------------------------------------------------------------------------------------------------------------------
46381
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
46382
+ -------------------------------------------------------------------------------------------------------------------------
46383
+  (0.1ms) SAVEPOINT active_record_1
46384
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46385
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46386
+  (0.1ms) SAVEPOINT active_record_1
46387
+ SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:43:18 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 349], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46388
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46389
+  (0.1ms) SAVEPOINT active_record_1
46390
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46391
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46392
+  (0.1ms) SAVEPOINT active_record_1
46393
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:41:18 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 350], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46394
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46395
+  (0.1ms) SAVEPOINT active_record_1
46396
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46397
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46398
+  (0.1ms) SAVEPOINT active_record_1
46399
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 351], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46400
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46401
+  (0.1ms) SAVEPOINT active_record_1
46402
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46403
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46404
+  (0.1ms) SAVEPOINT active_record_1
46405
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 352], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46406
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46407
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
46408
+  (0.1ms) ROLLBACK
46409
+  (0.1ms) BEGIN
46410
+ ---------------------------------------------------------------------------------------
46411
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
46412
+ ---------------------------------------------------------------------------------------
46413
+  (0.2ms) SAVEPOINT active_record_1
46414
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46415
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46416
+  (0.1ms) SAVEPOINT active_record_1
46417
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
46418
+  (0.2ms) SAVEPOINT active_record_1
46419
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46420
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46421
+  (0.1ms) SAVEPOINT active_record_1
46422
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
46423
+  (0.2ms) ROLLBACK
46424
+  (0.1ms) BEGIN
46425
+ --------------------------------------------------------------------------
46426
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
46427
+ --------------------------------------------------------------------------
46428
+  (0.1ms) SAVEPOINT active_record_1
46429
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46430
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46431
+  (0.1ms) SAVEPOINT active_record_1
46432
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 355], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46433
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46434
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 355]]
46435
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46436
+  (0.2ms) SAVEPOINT active_record_1
46437
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46438
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46439
+  (0.1ms) SAVEPOINT active_record_1
46440
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46441
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46442
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46443
+  (0.1ms) ROLLBACK
46444
+  (0.1ms) BEGIN
46445
+ ----------------------------------------------------------------------------------
46446
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
46447
+ ----------------------------------------------------------------------------------
46448
+  (0.1ms) SAVEPOINT active_record_1
46449
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46450
+  (0.3ms) RELEASE SAVEPOINT active_record_1
46451
+  (0.2ms) SAVEPOINT active_record_1
46452
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 356], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46453
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46454
+  (0.2ms) SAVEPOINT active_record_1
46455
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46456
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46457
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 356]]
46458
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46459
+  (0.2ms) ROLLBACK
46460
+  (0.2ms) BEGIN
46461
+ ----------------------------------------
46462
+ RoolerTest: test_delivers_pending_emails
46463
+ ----------------------------------------
46464
+  (0.2ms) SAVEPOINT active_record_1
46465
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46466
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46467
+  (0.1ms) SAVEPOINT active_record_1
46468
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 357], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46469
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46470
+  (0.1ms) SAVEPOINT active_record_1
46471
+ SQL (0.4ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]
46472
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46473
+  (0.1ms) SAVEPOINT active_record_1
46474
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 358], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46475
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46476
+  (0.1ms) SAVEPOINT active_record_1
46477
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 321 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1
46478
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["deliverable_id", 322], ["deliverable_type", "Rooler::Rule"], ["rule_id", 321], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46479
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46480
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
46481
+ Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 321]]
46482
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 322]]
46483
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
46484
+
46485
+ Sent mail to test@email.com (13.0ms)
46486
+ Date: Fri, 28 Mar 2014 12:52:19 +0100
46487
+ From: default@myapp.com
46488
+ To: test@email.com
46489
+ Message-ID: <53356273120d3_13be83fc471434cdc24132@Yonahs-MacBook-Pro.local.mail>
46490
+ Subject: subject-16
46491
+ Mime-Version: 1.0
46492
+ Content-Type: text/html;
46493
+ charset=UTF-8
46494
+ Content-Transfer-Encoding: 7bit
46495
+
46496
+ body-16
46497
+ SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:52:19.085448' WHERE "rooler_deliveries"."id" = 160
46498
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 160]]
46499
+  (0.2ms) ROLLBACK
46500
+  (0.1ms) BEGIN
46501
+ ------------------------------------------
46502
+ RoolerTest: test_processes_scheduled_rules
46503
+ ------------------------------------------
46504
+  (0.1ms) SAVEPOINT active_record_1
46505
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46506
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46507
+  (0.1ms) SAVEPOINT active_record_1
46508
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46509
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46510
+  (0.1ms) SAVEPOINT active_record_1
46511
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 359], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46512
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46513
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46514
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
46515
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 323]]
46516
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46517
+  (0.1ms) SAVEPOINT active_record_1
46518
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 323 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 215) LIMIT 1
46519
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["deliverable_id", 215], ["deliverable_type", "Foo"], ["rule_id", 323], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46520
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46521
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:19.109646' WHERE "rooler_rules"."id" = 323
46522
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46523
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
46524
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 215]]
46525
+  (0.2ms) ROLLBACK
46526
+  (0.1ms) BEGIN
46527
+ --------------------------------------------
46528
+ RoolerTest: test_resets_resetable_deliveries
46529
+ --------------------------------------------
46530
+  (0.1ms) SAVEPOINT active_record_1
46531
+ SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46532
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46533
+  (0.2ms) SAVEPOINT active_record_1
46534
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46535
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46536
+  (0.1ms) SAVEPOINT active_record_1
46537
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 360], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46538
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46539
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 324]]
46540
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46541
+  (0.1ms) SAVEPOINT active_record_1
46542
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 324 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 216) LIMIT 1
46543
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["deliverable_id", 216], ["deliverable_type", "Foo"], ["rule_id", 324], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46544
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46545
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:19.133903' WHERE "rooler_rules"."id" = 324
46546
+  (0.1ms) SAVEPOINT active_record_1
46547
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 216 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]
46548
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46549
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46550
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
46551
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 324]]
46552
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
46553
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (216) [["rule_id", 324]]
46554
+  (0.1ms) SAVEPOINT active_record_1
46555
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 162]]
46556
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46557
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46558
+  (0.2ms) ROLLBACK
46559
+  (0.1ms) BEGIN
46560
+ ----------------------------------------
46561
+ Rooler::DeliveryMailerTest: test_deliver
46562
+ ----------------------------------------
46563
+  (0.2ms) SAVEPOINT active_record_1
46564
+ SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00]]
46565
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46566
+  (0.2ms) SAVEPOINT active_record_1
46567
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 361], ["updated_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00]]
46568
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46569
+  (0.2ms) SAVEPOINT active_record_1
46570
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 325 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 325) LIMIT 1
46571
+ SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 325], ["deliverable_type", "Rooler::Rule"], ["rule_id", 325], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46572
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46573
+ Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 325]]
46574
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.7ms)
46575
+
46576
+ Sent mail to test_name@to.com (24.7ms)
46577
+ Date: Fri, 28 Mar 2014 12:53:14 +0100
46578
+ From: default@myapp.com
46579
+ To: test_name@to.com
46580
+ Cc: test_name@cc.com
46581
+ Message-ID: <533562aa3157b_13c293fd5bd834cd0537dc@Yonahs-MacBook-Pro.local.mail>
46582
+ Subject: subject is: test_name
46583
+ Mime-Version: 1.0
46584
+ Content-Type: text/html;
46585
+ charset=UTF-8
46586
+ Content-Transfer-Encoding: 7bit
46587
+
46588
+ body is: test_name
46589
+  (0.3ms) ROLLBACK
46590
+  (0.2ms) BEGIN
46591
+ ---------------------------------------------------------------------------------------
46592
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
46593
+ ---------------------------------------------------------------------------------------
46594
+  (0.1ms) SAVEPOINT active_record_1
46595
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46596
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46597
+  (0.2ms) SAVEPOINT active_record_1
46598
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46599
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46600
+  (0.1ms) SAVEPOINT active_record_1
46601
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 362], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46602
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46603
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
46604
+  (0.1ms) SAVEPOINT active_record_1
46605
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46606
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46607
+  (0.1ms) SAVEPOINT active_record_1
46608
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 363], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46609
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46610
+  (0.2ms) ROLLBACK
46611
+  (0.1ms) BEGIN
46612
+ ------------------------------------------------------------------------------
46613
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
46614
+ ------------------------------------------------------------------------------
46615
+  (0.1ms) SAVEPOINT active_record_1
46616
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46617
+  (0.3ms) RELEASE SAVEPOINT active_record_1
46618
+  (0.2ms) SAVEPOINT active_record_1
46619
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46620
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46621
+  (0.1ms) SAVEPOINT active_record_1
46622
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 364], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46623
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46624
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46625
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 328]]
46626
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46627
+  (0.1ms) SAVEPOINT active_record_1
46628
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 328 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 218) LIMIT 1
46629
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 218], ["deliverable_type", "Foo"], ["rule_id", 328], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46630
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46631
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.286515' WHERE "rooler_rules"."id" = 328
46632
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46633
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46634
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 328]]
46635
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (218))
46636
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.291693' WHERE "rooler_rules"."id" = 328
46637
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46638
+  (0.1ms) ROLLBACK
46639
+  (0.2ms) BEGIN
46640
+ --------------------------------------------------------------------------------------------------------
46641
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
46642
+ --------------------------------------------------------------------------------------------------------
46643
+  (0.1ms) SAVEPOINT active_record_1
46644
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46645
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46646
+  (0.1ms) SAVEPOINT active_record_1
46647
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46648
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46649
+  (0.1ms) SAVEPOINT active_record_1
46650
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46651
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46652
+  (0.1ms) SAVEPOINT active_record_1
46653
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 365], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46654
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46655
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
46656
+  (0.1ms) ROLLBACK
46657
+  (0.1ms) BEGIN
46658
+ --------------------------------------------------------------------------------------------------------------------------------------
46659
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
46660
+ --------------------------------------------------------------------------------------------------------------------------------------
46661
+  (0.1ms) SAVEPOINT active_record_1
46662
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46663
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46664
+  (0.1ms) SAVEPOINT active_record_1
46665
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46666
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46667
+  (0.1ms) SAVEPOINT active_record_1
46668
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 366], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46669
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46670
+  (0.1ms) SAVEPOINT active_record_1
46671
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46672
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46673
+  (0.1ms) SAVEPOINT active_record_1
46674
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 367], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46675
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46676
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 330]]
46677
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46678
+  (0.1ms) SAVEPOINT active_record_1
46679
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 330 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1
46680
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Foo"], ["rule_id", 330], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46681
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46682
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.335322' WHERE "rooler_rules"."id" = 330
46683
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
46684
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]]
46685
+  (0.1ms) SAVEPOINT active_record_1
46686
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 331 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1
46687
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Foo"], ["rule_id", 331], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46688
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46689
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.342684' WHERE "rooler_rules"."id" = 331
46690
+  (0.1ms) SAVEPOINT active_record_1
46691
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46692
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46693
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 330]]
46694
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 330]]
46695
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (221))
46696
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 331]]
46697
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
46698
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]]
46699
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]]
46700
+  (0.2ms) ROLLBACK
46701
+  (0.1ms) BEGIN
46702
+ ----------------------------------------------------------------------------------------------------
46703
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
46704
+ ----------------------------------------------------------------------------------------------------
46705
+  (0.1ms) SAVEPOINT active_record_1
46706
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46707
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46708
+  (0.1ms) SAVEPOINT active_record_1
46709
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46710
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46711
+  (0.1ms) SAVEPOINT active_record_1
46712
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 368], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46713
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46714
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]]
46715
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46716
+  (0.1ms) SAVEPOINT active_record_1
46717
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 332 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 223) LIMIT 1
46718
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 223], ["deliverable_type", "Foo"], ["rule_id", 332], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46719
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46720
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.372240' WHERE "rooler_rules"."id" = 332
46721
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]]
46722
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (223))
46723
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46724
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]]
46725
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (223))
46726
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.377584' WHERE "rooler_rules"."id" = 332
46727
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46728
+  (0.1ms) SAVEPOINT active_record_1
46729
+ SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 223 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46730
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46731
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46732
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]]
46733
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
46734
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (223) [["rule_id", 332]]
46735
+  (0.1ms) SAVEPOINT active_record_1
46736
+ SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 167]]
46737
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46738
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46739
+  (0.1ms) SAVEPOINT active_record_1
46740
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 223 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46741
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46742
+  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"
46743
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]]
46744
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46745
+  (0.2ms) SAVEPOINT active_record_1
46746
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 332 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 223) LIMIT 1
46747
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 223], ["deliverable_type", "Foo"], ["rule_id", 332], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46748
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46749
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.406577' WHERE "rooler_rules"."id" = 332
46750
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46751
+  (0.2ms) ROLLBACK
46752
+  (0.1ms) BEGIN
46753
+ -------------------------------------------------------------------------------------------------------------------------
46754
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
46755
+ -------------------------------------------------------------------------------------------------------------------------
46756
+  (0.1ms) SAVEPOINT active_record_1
46757
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46758
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46759
+  (0.1ms) SAVEPOINT active_record_1
46760
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:44:14 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 369], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46761
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46762
+  (0.1ms) SAVEPOINT active_record_1
46763
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46764
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46765
+  (0.2ms) SAVEPOINT active_record_1
46766
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:42:14 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 370], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46767
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46768
+  (0.1ms) SAVEPOINT active_record_1
46769
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46770
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46771
+  (0.1ms) SAVEPOINT active_record_1
46772
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 371], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46773
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46774
+  (0.1ms) SAVEPOINT active_record_1
46775
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46776
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46777
+  (0.1ms) SAVEPOINT active_record_1
46778
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 372], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46779
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46780
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
46781
+  (0.1ms) ROLLBACK
46782
+  (0.2ms) BEGIN
46783
+ ---------------------------------------------------------------------------------------
46784
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
46785
+ ---------------------------------------------------------------------------------------
46786
+  (0.2ms) SAVEPOINT active_record_1
46787
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46788
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46789
+  (0.1ms) SAVEPOINT active_record_1
46790
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
46791
+  (0.2ms) SAVEPOINT active_record_1
46792
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46793
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46794
+  (0.1ms) SAVEPOINT active_record_1
46795
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
46796
+  (0.1ms) ROLLBACK
46797
+  (0.1ms) BEGIN
46798
+ --------------------------------------------------------------------------
46799
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
46800
+ --------------------------------------------------------------------------
46801
+  (0.2ms) SAVEPOINT active_record_1
46802
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46803
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46804
+  (0.1ms) SAVEPOINT active_record_1
46805
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 375], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46806
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46807
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 375]]
46808
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46809
+  (0.1ms) SAVEPOINT active_record_1
46810
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46811
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46812
+  (0.1ms) SAVEPOINT active_record_1
46813
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46814
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46815
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46816
+  (0.2ms) ROLLBACK
46817
+  (0.1ms) BEGIN
46818
+ ----------------------------------------------------------------------------------
46819
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
46820
+ ----------------------------------------------------------------------------------
46821
+  (0.2ms) SAVEPOINT active_record_1
46822
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46823
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46824
+  (0.1ms) SAVEPOINT active_record_1
46825
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 376], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46826
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46827
+  (0.1ms) SAVEPOINT active_record_1
46828
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46829
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46830
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 376]]
46831
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
46832
+  (0.3ms) ROLLBACK
46833
+  (0.1ms) BEGIN
46834
+ ----------------------------------------
46835
+ RoolerTest: test_delivers_pending_emails
46836
+ ----------------------------------------
46837
+  (0.2ms) SAVEPOINT active_record_1
46838
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46839
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46840
+  (0.1ms) SAVEPOINT active_record_1
46841
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 377], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46842
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46843
+  (0.1ms) SAVEPOINT active_record_1
46844
+ SQL (0.4ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46845
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46846
+  (0.1ms) SAVEPOINT active_record_1
46847
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 378], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46848
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46849
+  (0.1ms) SAVEPOINT active_record_1
46850
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 339 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 340) LIMIT 1
46851
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 340], ["deliverable_type", "Rooler::Rule"], ["rule_id", 339], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46852
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46853
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
46854
+ Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 339]]
46855
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 340]]
46856
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
46857
+
46858
+ Sent mail to test@email.com (13.1ms)
46859
+ Date: Fri, 28 Mar 2014 12:53:14 +0100
46860
+ From: default@myapp.com
46861
+ To: test@email.com
46862
+ Message-ID: <533562aa9f90e_13c293fd5bd834cd0538b0@Yonahs-MacBook-Pro.local.mail>
46863
+ Subject: subject-16
46864
+ Mime-Version: 1.0
46865
+ Content-Type: text/html;
46866
+ charset=UTF-8
46867
+ Content-Transfer-Encoding: 7bit
46868
+
46869
+ body-16
46870
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:53:14.665081' WHERE "rooler_deliveries"."id" = 169
46871
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 169]]
46872
+  (0.2ms) ROLLBACK
46873
+  (0.1ms) BEGIN
46874
+ ------------------------------------------
46875
+ RoolerTest: test_processes_scheduled_rules
46876
+ ------------------------------------------
46877
+  (0.1ms) SAVEPOINT active_record_1
46878
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46879
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46880
+  (0.2ms) SAVEPOINT active_record_1
46881
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46882
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46883
+  (0.1ms) SAVEPOINT active_record_1
46884
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 379], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46885
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46886
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46887
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
46888
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 341]]
46889
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
46890
+  (0.1ms) SAVEPOINT active_record_1
46891
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 341 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 227) LIMIT 1
46892
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 227], ["deliverable_type", "Foo"], ["rule_id", 341], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46893
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46894
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.689202' WHERE "rooler_rules"."id" = 341
46895
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46896
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
46897
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 227]]
46898
+  (0.2ms) ROLLBACK
46899
+  (0.1ms) BEGIN
46900
+ --------------------------------------------
46901
+ RoolerTest: test_resets_resetable_deliveries
46902
+ --------------------------------------------
46903
+  (0.1ms) SAVEPOINT active_record_1
46904
+ SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46905
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46906
+  (0.1ms) SAVEPOINT active_record_1
46907
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46908
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46909
+  (0.1ms) SAVEPOINT active_record_1
46910
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 380], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46911
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46912
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]]
46913
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
46914
+  (0.2ms) SAVEPOINT active_record_1
46915
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 342 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 228) LIMIT 1
46916
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 228], ["deliverable_type", "Foo"], ["rule_id", 342], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46917
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46918
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.713589' WHERE "rooler_rules"."id" = 342
46919
+  (0.1ms) SAVEPOINT active_record_1
46920
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 228 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]
46921
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46922
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46923
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
46924
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]]
46925
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
46926
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (228) [["rule_id", 342]]
46927
+  (0.1ms) SAVEPOINT active_record_1
46928
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 171]]
46929
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46930
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
46931
+  (0.1ms) ROLLBACK
46932
+  (0.2ms) BEGIN
46933
+ ----------------------------------------
46934
+ Rooler::DeliveryMailerTest: test_deliver
46935
+ ----------------------------------------
46936
+  (0.2ms) SAVEPOINT active_record_1
46937
+ SQL (6.4ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46938
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46939
+  (0.2ms) SAVEPOINT active_record_1
46940
+ SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 381], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46941
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46942
+  (0.2ms) SAVEPOINT active_record_1
46943
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 343 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 343) LIMIT 1
46944
+ SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 343], ["deliverable_type", "Rooler::Rule"], ["rule_id", 343], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46945
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46946
+ Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 343]]
46947
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.1ms)
46948
+
46949
+ Sent mail to test_name@to.com (25.8ms)
46950
+ Date: Fri, 28 Mar 2014 12:53:36 +0100
46951
+ From: default@myapp.com
46952
+ To: test_name@to.com
46953
+ Cc: test_name@cc.com
46954
+ Message-ID: <533562c05d08a_13c483fe8ddc34cd014640@Yonahs-MacBook-Pro.local.mail>
46955
+ Subject: subject is: test_name
46956
+ Mime-Version: 1.0
46957
+ Content-Type: text/html;
46958
+ charset=UTF-8
46959
+ Content-Transfer-Encoding: 7bit
46960
+
46961
+ body is: test_name
46962
+  (0.3ms) ROLLBACK
46963
+  (0.1ms) BEGIN
46964
+ ---------------------------------------------------------------------------------------
46965
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
46966
+ ---------------------------------------------------------------------------------------
46967
+  (0.1ms) SAVEPOINT active_record_1
46968
+ SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46969
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46970
+  (0.1ms) SAVEPOINT active_record_1
46971
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46972
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46973
+  (0.1ms) SAVEPOINT active_record_1
46974
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 382], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46975
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46976
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
46977
+  (0.2ms) SAVEPOINT active_record_1
46978
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46979
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46980
+  (0.1ms) SAVEPOINT active_record_1
46981
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 383], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46982
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46983
+  (0.2ms) ROLLBACK
46984
+  (0.1ms) BEGIN
46985
+ ------------------------------------------------------------------------------
46986
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
46987
+ ------------------------------------------------------------------------------
46988
+  (0.1ms) SAVEPOINT active_record_1
46989
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46990
+  (0.2ms) RELEASE SAVEPOINT active_record_1
46991
+  (0.2ms) SAVEPOINT active_record_1
46992
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46993
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46994
+  (0.1ms) SAVEPOINT active_record_1
46995
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 384], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
46996
+  (0.1ms) RELEASE SAVEPOINT active_record_1
46997
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
46998
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 346]]
46999
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47000
+  (0.1ms) SAVEPOINT active_record_1
47001
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 346 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 230) LIMIT 1
47002
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 230], ["deliverable_type", "Foo"], ["rule_id", 346], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47003
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47004
+ SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.469147' WHERE "rooler_rules"."id" = 346
47005
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47006
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47007
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 346]]
47008
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (230))
47009
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.474422' WHERE "rooler_rules"."id" = 346
47010
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47011
+  (0.1ms) ROLLBACK
47012
+  (0.1ms) BEGIN
47013
+ --------------------------------------------------------------------------------------------------------
47014
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
47015
+ --------------------------------------------------------------------------------------------------------
47016
+  (0.2ms) SAVEPOINT active_record_1
47017
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47018
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47019
+  (0.1ms) SAVEPOINT active_record_1
47020
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47021
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47022
+  (0.1ms) SAVEPOINT active_record_1
47023
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47024
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47025
+  (0.1ms) SAVEPOINT active_record_1
47026
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 385], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47027
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47028
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
47029
+  (0.2ms) ROLLBACK
47030
+  (0.1ms) BEGIN
47031
+ --------------------------------------------------------------------------------------------------------------------------------------
47032
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
47033
+ --------------------------------------------------------------------------------------------------------------------------------------
47034
+  (0.1ms) SAVEPOINT active_record_1
47035
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47036
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47037
+  (0.1ms) SAVEPOINT active_record_1
47038
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47039
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47040
+  (0.1ms) SAVEPOINT active_record_1
47041
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 386], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47042
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47043
+  (0.2ms) SAVEPOINT active_record_1
47044
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47045
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47046
+  (0.2ms) SAVEPOINT active_record_1
47047
+ SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 387], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47048
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47049
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 348]]
47050
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47051
+  (0.2ms) SAVEPOINT active_record_1
47052
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 348 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 233) LIMIT 1
47053
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 233], ["deliverable_type", "Foo"], ["rule_id", 348], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47054
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47055
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.528462' WHERE "rooler_rules"."id" = 348
47056
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
47057
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]]
47058
+  (0.1ms) SAVEPOINT active_record_1
47059
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 349 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 233) LIMIT 1
47060
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 233], ["deliverable_type", "Foo"], ["rule_id", 349], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47061
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47062
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.535674' WHERE "rooler_rules"."id" = 349
47063
+  (0.1ms) SAVEPOINT active_record_1
47064
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47065
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47066
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 348]]
47067
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 348]]
47068
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (233))
47069
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 349]]
47070
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
47071
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]]
47072
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]]
47073
+  (0.3ms) ROLLBACK
47074
+  (0.1ms) BEGIN
47075
+ ----------------------------------------------------------------------------------------------------
47076
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
47077
+ ----------------------------------------------------------------------------------------------------
47078
+  (0.1ms) SAVEPOINT active_record_1
47079
+ SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47080
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47081
+  (0.1ms) SAVEPOINT active_record_1
47082
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47083
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47084
+  (0.1ms) SAVEPOINT active_record_1
47085
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 388], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47086
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47087
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]
47088
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47089
+  (0.1ms) SAVEPOINT active_record_1
47090
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 350 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1
47091
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Foo"], ["rule_id", 350], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47092
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47093
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.568427' WHERE "rooler_rules"."id" = 350
47094
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]
47095
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (235))
47096
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47097
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]
47098
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (235))
47099
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.574270' WHERE "rooler_rules"."id" = 350
47100
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47101
+  (0.1ms) SAVEPOINT active_record_1
47102
+ SQL (1.1ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 235 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47103
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47104
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47105
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]
47106
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
47107
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (235) [["rule_id", 350]]
47108
+  (0.2ms) SAVEPOINT active_record_1
47109
+ SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 176]]
47110
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47111
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47112
+  (0.1ms) SAVEPOINT active_record_1
47113
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 235 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47114
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47115
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47116
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]
47117
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47118
+  (0.1ms) SAVEPOINT active_record_1
47119
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 350 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1
47120
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Foo"], ["rule_id", 350], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47121
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47122
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.599357' WHERE "rooler_rules"."id" = 350
47123
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47124
+  (0.2ms) ROLLBACK
47125
+  (0.1ms) BEGIN
47126
+ -------------------------------------------------------------------------------------------------------------------------
47127
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
47128
+ -------------------------------------------------------------------------------------------------------------------------
47129
+  (0.1ms) SAVEPOINT active_record_1
47130
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47131
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47132
+  (0.1ms) SAVEPOINT active_record_1
47133
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:44:36 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 389], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47134
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47135
+  (0.2ms) SAVEPOINT active_record_1
47136
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47137
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47138
+  (0.1ms) SAVEPOINT active_record_1
47139
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:42:36 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 390], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47140
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47141
+  (0.2ms) SAVEPOINT active_record_1
47142
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47143
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47144
+  (0.1ms) SAVEPOINT active_record_1
47145
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 391], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47146
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47147
+  (0.1ms) SAVEPOINT active_record_1
47148
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47149
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47150
+  (0.1ms) SAVEPOINT active_record_1
47151
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 392], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47152
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47153
+ Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
47154
+  (0.2ms) ROLLBACK
47155
+  (0.1ms) BEGIN
47156
+ ---------------------------------------------------------------------------------------
47157
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
47158
+ ---------------------------------------------------------------------------------------
47159
+  (0.1ms) SAVEPOINT active_record_1
47160
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47161
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47162
+  (0.1ms) SAVEPOINT active_record_1
47163
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
47164
+  (0.2ms) SAVEPOINT active_record_1
47165
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47166
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47167
+  (0.1ms) SAVEPOINT active_record_1
47168
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
47169
+  (0.2ms) ROLLBACK
47170
+  (0.1ms) BEGIN
47171
+ --------------------------------------------------------------------------
47172
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
47173
+ --------------------------------------------------------------------------
47174
+  (0.2ms) SAVEPOINT active_record_1
47175
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47176
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47177
+  (0.1ms) SAVEPOINT active_record_1
47178
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 395], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47179
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47180
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 395]]
47181
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47182
+  (0.2ms) SAVEPOINT active_record_1
47183
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47184
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47185
+  (0.1ms) SAVEPOINT active_record_1
47186
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47187
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47188
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47189
+  (0.2ms) ROLLBACK
47190
+  (0.3ms) BEGIN
47191
+ ----------------------------------------------------------------------------------
47192
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
47193
+ ----------------------------------------------------------------------------------
47194
+  (0.2ms) SAVEPOINT active_record_1
47195
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47196
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47197
+  (0.1ms) SAVEPOINT active_record_1
47198
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 396], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47199
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47200
+  (0.1ms) SAVEPOINT active_record_1
47201
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47202
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47203
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 396]]
47204
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47205
+  (0.3ms) ROLLBACK
47206
+  (0.2ms) BEGIN
47207
+ ----------------------------------------
47208
+ RoolerTest: test_delivers_pending_emails
47209
+ ----------------------------------------
47210
+  (0.3ms) SAVEPOINT active_record_1
47211
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47212
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47213
+  (0.1ms) SAVEPOINT active_record_1
47214
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 397], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47215
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47216
+  (0.1ms) SAVEPOINT active_record_1
47217
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47218
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47219
+  (0.1ms) SAVEPOINT active_record_1
47220
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 398], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47221
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47222
+  (0.1ms) SAVEPOINT active_record_1
47223
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 357 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 358) LIMIT 1
47224
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 358], ["deliverable_type", "Rooler::Rule"], ["rule_id", 357], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47225
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47226
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
47227
+ Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 357]]
47228
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 358]]
47229
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
47230
+
47231
+ Sent mail to test@email.com (13.9ms)
47232
+ Date: Fri, 28 Mar 2014 12:53:36 +0100
47233
+ From: default@myapp.com
47234
+ To: test@email.com
47235
+ Message-ID: <533562c0d50c9_13c483fe8ddc34cd014736@Yonahs-MacBook-Pro.local.mail>
47236
+ Subject: subject-16
47237
+ Mime-Version: 1.0
47238
+ Content-Type: text/html;
47239
+ charset=UTF-8
47240
+ Content-Transfer-Encoding: 7bit
47241
+
47242
+ body-16
47243
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:53:36.884787' WHERE "rooler_deliveries"."id" = 178
47244
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 178]]
47245
+  (0.2ms) ROLLBACK
47246
+  (0.1ms) BEGIN
47247
+ ------------------------------------------
47248
+ RoolerTest: test_processes_scheduled_rules
47249
+ ------------------------------------------
47250
+  (0.1ms) SAVEPOINT active_record_1
47251
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47252
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47253
+  (0.1ms) SAVEPOINT active_record_1
47254
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47255
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47256
+  (0.3ms) SAVEPOINT active_record_1
47257
+ SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 399], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47258
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47259
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
47260
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
47261
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 359]]
47262
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47263
+  (0.1ms) SAVEPOINT active_record_1
47264
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 359 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 239) LIMIT 1
47265
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 239], ["deliverable_type", "Foo"], ["rule_id", 359], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47266
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47267
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.914577' WHERE "rooler_rules"."id" = 359
47268
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47269
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
47270
+ Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 239]]
47271
+  (0.2ms) ROLLBACK
47272
+  (0.2ms) BEGIN
47273
+ --------------------------------------------
47274
+ RoolerTest: test_resets_resetable_deliveries
47275
+ --------------------------------------------
47276
+  (0.1ms) SAVEPOINT active_record_1
47277
+ SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47278
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47279
+  (0.2ms) SAVEPOINT active_record_1
47280
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47281
+  (0.3ms) RELEASE SAVEPOINT active_record_1
47282
+  (0.1ms) SAVEPOINT active_record_1
47283
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 400], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47284
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47285
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 360]]
47286
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47287
+  (0.1ms) SAVEPOINT active_record_1
47288
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 360 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 240) LIMIT 1
47289
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 240], ["deliverable_type", "Foo"], ["rule_id", 360], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47290
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47291
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.940214' WHERE "rooler_rules"."id" = 360
47292
+  (0.1ms) SAVEPOINT active_record_1
47293
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 240 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]
47294
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47295
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47296
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
47297
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 360]]
47298
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
47299
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (240) [["rule_id", 360]]
47300
+  (0.1ms) SAVEPOINT active_record_1
47301
+ SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 180]]
47302
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47303
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47304
+  (0.2ms) ROLLBACK
47305
+  (0.1ms) BEGIN
47306
+ ----------------------------------------
47307
+ Rooler::DeliveryMailerTest: test_deliver
47308
+ ----------------------------------------
47309
+  (0.2ms) SAVEPOINT active_record_1
47310
+ SQL (23.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00]]
47311
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47312
+  (0.2ms) SAVEPOINT active_record_1
47313
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 401], ["updated_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00]]
47314
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47315
+  (0.2ms) SAVEPOINT active_record_1
47316
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 361 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 361) LIMIT 1
47317
+ SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00], ["deliverable_id", 361], ["deliverable_type", "Rooler::Rule"], ["rule_id", 361], ["updated_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00]]
47318
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47319
+ Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 361]]
47320
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.9ms)
47321
+
47322
+ Sent mail to test_name@to.com (27.4ms)
47323
+ Date: Fri, 28 Mar 2014 12:56:38 +0100
47324
+ From: default@myapp.com
47325
+ To: test_name@to.com
47326
+ Cc: test_name@cc.com
47327
+ Message-ID: <533563762d76_13d083fe918c34ce0865e2@Yonahs-MacBook-Pro.local.mail>
47328
+ Subject: subject is: test_name
47329
+ Mime-Version: 1.0
47330
+ Content-Type: text/html;
47331
+ charset=UTF-8
47332
+ Content-Transfer-Encoding: 7bit
47333
+
47334
+ body is: test_name
47335
+  (0.4ms) ROLLBACK
47336
+  (0.2ms) BEGIN
47337
+ ---------------------------------------------------------------------------------------
47338
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
47339
+ ---------------------------------------------------------------------------------------
47340
+  (0.1ms) SAVEPOINT active_record_1
47341
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47342
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47343
+  (0.1ms) SAVEPOINT active_record_1
47344
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47345
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47346
+  (0.1ms) SAVEPOINT active_record_1
47347
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 402], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47348
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47349
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
47350
+  (0.2ms) SAVEPOINT active_record_1
47351
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47352
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47353
+  (0.1ms) SAVEPOINT active_record_1
47354
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 403], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47355
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47356
+  (0.2ms) ROLLBACK
47357
+  (0.1ms) BEGIN
47358
+ ------------------------------------------------------------------------------
47359
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
47360
+ ------------------------------------------------------------------------------
47361
+  (0.1ms) SAVEPOINT active_record_1
47362
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47363
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47364
+  (0.2ms) SAVEPOINT active_record_1
47365
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47366
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47367
+  (0.1ms) SAVEPOINT active_record_1
47368
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 404], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47369
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47370
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47371
+  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 364]]
47372
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47373
+  (0.1ms) SAVEPOINT active_record_1
47374
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 364 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 242) LIMIT 1
47375
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 242], ["deliverable_type", "Foo"], ["rule_id", 364], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47376
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47377
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.097952' WHERE "rooler_rules"."id" = 364
47378
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47379
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47380
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 364]]
47381
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (242))
47382
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.102819' WHERE "rooler_rules"."id" = 364
47383
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47384
+  (0.1ms) ROLLBACK
47385
+  (0.1ms) BEGIN
47386
+ --------------------------------------------------------------------------------------------------------
47387
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
47388
+ --------------------------------------------------------------------------------------------------------
47389
+  (0.1ms) SAVEPOINT active_record_1
47390
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47391
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47392
+  (0.1ms) SAVEPOINT active_record_1
47393
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47394
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47395
+  (0.2ms) SAVEPOINT active_record_1
47396
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47397
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47398
+  (0.1ms) SAVEPOINT active_record_1
47399
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 405], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47400
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47401
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1
47402
+  (0.2ms) ROLLBACK
47403
+  (0.2ms) BEGIN
47404
+ --------------------------------------------------------------------------------------------------------------------------------------
47405
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
47406
+ --------------------------------------------------------------------------------------------------------------------------------------
47407
+  (0.2ms) SAVEPOINT active_record_1
47408
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47409
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47410
+  (0.2ms) SAVEPOINT active_record_1
47411
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47412
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47413
+  (0.1ms) SAVEPOINT active_record_1
47414
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 406], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47415
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47416
+  (0.2ms) SAVEPOINT active_record_1
47417
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47418
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47419
+  (0.1ms) SAVEPOINT active_record_1
47420
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 407], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47421
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47422
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]]
47423
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47424
+  (0.2ms) SAVEPOINT active_record_1
47425
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 366 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 245) LIMIT 1
47426
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 245], ["deliverable_type", "Foo"], ["rule_id", 366], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47427
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47428
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.175286' WHERE "rooler_rules"."id" = 366
47429
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
47430
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]
47431
+  (0.2ms) SAVEPOINT active_record_1
47432
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 245) LIMIT 1
47433
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 245], ["deliverable_type", "Foo"], ["rule_id", 367], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47434
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47435
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.186389' WHERE "rooler_rules"."id" = 367
47436
+  (0.2ms) SAVEPOINT active_record_1
47437
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47438
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47439
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 366]]
47440
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]]
47441
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (245))
47442
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 367]]
47443
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
47444
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]
47445
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]
47446
+  (0.2ms) ROLLBACK
47447
+  (0.1ms) BEGIN
47448
+ ----------------------------------------------------------------------------------------------------
47449
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
47450
+ ----------------------------------------------------------------------------------------------------
47451
+  (0.2ms) SAVEPOINT active_record_1
47452
+ SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47453
+  (0.3ms) RELEASE SAVEPOINT active_record_1
47454
+  (0.2ms) SAVEPOINT active_record_1
47455
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47456
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47457
+  (0.2ms) SAVEPOINT active_record_1
47458
+ SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 408], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47459
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47460
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]]
47461
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47462
+  (0.1ms) SAVEPOINT active_record_1
47463
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 368 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 247) LIMIT 1
47464
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 247], ["deliverable_type", "Foo"], ["rule_id", 368], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47465
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47466
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.233790' WHERE "rooler_rules"."id" = 368
47467
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]]
47468
+  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (247))
47469
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
47470
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]]
47471
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (247))
47472
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.243238' WHERE "rooler_rules"."id" = 368
47473
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47474
+  (0.1ms) SAVEPOINT active_record_1
47475
+ SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 247 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47476
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47477
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
47478
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]]
47479
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
47480
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (247) [["rule_id", 368]]
47481
+  (0.2ms) SAVEPOINT active_record_1
47482
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 185]]
47483
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47484
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
47485
+  (0.1ms) SAVEPOINT active_record_1
47486
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 247 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47487
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47488
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47489
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]]
47490
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47491
+  (0.1ms) SAVEPOINT active_record_1
47492
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 368 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 247) LIMIT 1
47493
+ SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 247], ["deliverable_type", "Foo"], ["rule_id", 368], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47494
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47495
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.276805' WHERE "rooler_rules"."id" = 368
47496
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47497
+  (0.2ms) ROLLBACK
47498
+  (0.2ms) BEGIN
47499
+ -------------------------------------------------------------------------------------------------------------------------
47500
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
47501
+ -------------------------------------------------------------------------------------------------------------------------
47502
+  (0.2ms) SAVEPOINT active_record_1
47503
+ SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47504
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47505
+  (0.2ms) SAVEPOINT active_record_1
47506
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:47:38 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 409], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47507
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47508
+  (0.2ms) SAVEPOINT active_record_1
47509
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47510
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47511
+  (0.2ms) SAVEPOINT active_record_1
47512
+ SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:45:38 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 410], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47513
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47514
+  (0.2ms) SAVEPOINT active_record_1
47515
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47516
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47517
+  (0.2ms) SAVEPOINT active_record_1
47518
+ SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 411], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47519
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47520
+  (0.2ms) SAVEPOINT active_record_1
47521
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47522
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47523
+  (0.2ms) SAVEPOINT active_record_1
47524
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 412], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47525
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47526
+ Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
47527
+  (0.2ms) ROLLBACK
47528
+  (0.2ms) BEGIN
47529
+ ---------------------------------------------------------------------------------------
47530
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
47531
+ ---------------------------------------------------------------------------------------
47532
+  (0.2ms) SAVEPOINT active_record_1
47533
+ SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47534
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47535
+  (0.1ms) SAVEPOINT active_record_1
47536
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
47537
+  (0.2ms) SAVEPOINT active_record_1
47538
+ SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47539
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47540
+  (0.1ms) SAVEPOINT active_record_1
47541
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
47542
+  (0.1ms) ROLLBACK
47543
+  (0.1ms) BEGIN
47544
+ --------------------------------------------------------------------------
47545
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
47546
+ --------------------------------------------------------------------------
47547
+  (0.1ms) SAVEPOINT active_record_1
47548
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47549
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47550
+  (0.1ms) SAVEPOINT active_record_1
47551
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 415], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47552
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47553
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 415]]
47554
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47555
+  (0.1ms) SAVEPOINT active_record_1
47556
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47557
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47558
+  (0.1ms) SAVEPOINT active_record_1
47559
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47560
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47561
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47562
+  (0.2ms) ROLLBACK
47563
+  (0.1ms) BEGIN
47564
+ ----------------------------------------------------------------------------------
47565
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
47566
+ ----------------------------------------------------------------------------------
47567
+  (0.1ms) SAVEPOINT active_record_1
47568
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47569
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47570
+  (0.1ms) SAVEPOINT active_record_1
47571
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 416], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47572
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47573
+  (0.1ms) SAVEPOINT active_record_1
47574
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47575
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47576
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 416]]
47577
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47578
+  (0.4ms) ROLLBACK
47579
+  (0.2ms) BEGIN
47580
+ ----------------------------------------
47581
+ RoolerTest: test_delivers_pending_emails
47582
+ ----------------------------------------
47583
+  (0.2ms) SAVEPOINT active_record_1
47584
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47585
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47586
+  (0.1ms) SAVEPOINT active_record_1
47587
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 417], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47588
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47589
+  (0.1ms) SAVEPOINT active_record_1
47590
+ SQL (0.4ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47591
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47592
+  (0.1ms) SAVEPOINT active_record_1
47593
+ SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 418], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47594
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47595
+  (0.1ms) SAVEPOINT active_record_1
47596
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 375 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 376) LIMIT 1
47597
+ SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 376], ["deliverable_type", "Rooler::Rule"], ["rule_id", 375], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47598
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47599
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
47600
+ Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 375]]
47601
+ Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 376]]
47602
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
47603
+
47604
+ Sent mail to test@email.com (13.4ms)
47605
+ Date: Fri, 28 Mar 2014 12:56:38 +0100
47606
+ From: default@myapp.com
47607
+ To: test@email.com
47608
+ Message-ID: <533563768dc72_13d083fe918c34ce08668@Yonahs-MacBook-Pro.local.mail>
47609
+ Subject: subject-16
47610
+ Mime-Version: 1.0
47611
+ Content-Type: text/html;
47612
+ charset=UTF-8
47613
+ Content-Transfer-Encoding: 7bit
47614
+
47615
+ body-16
47616
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:56:38.592529' WHERE "rooler_deliveries"."id" = 187
47617
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 187]]
47618
+  (0.2ms) ROLLBACK
47619
+  (0.1ms) BEGIN
47620
+ ------------------------------------------
47621
+ RoolerTest: test_processes_scheduled_rules
47622
+ ------------------------------------------
47623
+  (0.2ms) SAVEPOINT active_record_1
47624
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47625
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47626
+  (0.2ms) SAVEPOINT active_record_1
47627
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47628
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47629
+  (0.1ms) SAVEPOINT active_record_1
47630
+ SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 419], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47631
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47632
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47633
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())
47634
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 377]]
47635
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47636
+  (0.1ms) SAVEPOINT active_record_1
47637
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 377 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 251) LIMIT 1
47638
+ SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 251], ["deliverable_type", "Foo"], ["rule_id", 377], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47639
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47640
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.620222' WHERE "rooler_rules"."id" = 377
47641
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47642
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
47643
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 251]]
47644
+  (0.2ms) ROLLBACK
47645
+  (0.1ms) BEGIN
47646
+ --------------------------------------------
47647
+ RoolerTest: test_resets_resetable_deliveries
47648
+ --------------------------------------------
47649
+  (0.2ms) SAVEPOINT active_record_1
47650
+ SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47651
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47652
+  (0.2ms) SAVEPOINT active_record_1
47653
+ SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47654
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47655
+  (0.1ms) SAVEPOINT active_record_1
47656
+ SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 420], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47657
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47658
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 378]]
47659
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47660
+  (0.1ms) SAVEPOINT active_record_1
47661
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 378 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 252) LIMIT 1
47662
+ SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 252], ["deliverable_type", "Foo"], ["rule_id", 378], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47663
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47664
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.646127' WHERE "rooler_rules"."id" = 378
47665
+  (0.1ms) SAVEPOINT active_record_1
47666
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 252 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]
47667
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47668
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47669
+ Rooler::Rule Load (0.2ms) SELECT "rooler_rules".* FROM "rooler_rules"
47670
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 378]]
47671
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
47672
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (252) [["rule_id", 378]]
47673
+  (0.1ms) SAVEPOINT active_record_1
47674
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 189]]
47675
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47676
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47677
+  (0.1ms) ROLLBACK