rooler 0.0.9 → 0.0.10

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
- MGM0OWZiNzM1ZmExY2NlOWQxZjA0ODgwMTk3Y2Y2MjJjNjQ1ODVkMw==
4
+ ZDBkZjdmNWEzMzYzZDJjNjdhOTFjNzVlOWMxZjk5NGJiMWYwOTdiMA==
5
5
  data.tar.gz: !binary |-
6
- MmYxYjY3NDE0NDQwYzE3M2U2ODRlZjY0ZjkyMTY3MjAzNWUwMzU1Yw==
6
+ YTEzMzcyYmJlYjg3ZjlhN2VkYmZmYjk0ODQxMmY1YmQ2ZGExMjUyOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2VmZWQzNWM1M2EwOGRkZjE3ODY0OTc1OGQ2Yjc5ZWZkMzMzYzFkYjZjYTMw
10
- MTBiOTQyN2QyNzFhZTdhYzRjMjFjZWI1YWRkZDdjODVkMzM5OTY0NmE5YTYy
11
- MWIzMTY0ZDMxNTg3ZTNlNmU2NGFjN2IyNDljZGU4MjQ2ZWI3YWQ=
9
+ OWM2Y2M0NjQ4OTZmM2JhZDZiZmE3ZjgxODRlMGQyMTY5OTcxYTViMmU3NTRm
10
+ ODkyNDRiZGY4N2JiZWM5M2YwNmIyOTBlYmM3NTQzMDMwOTBiODViOTg3ODc4
11
+ ZWVjYjM2ODQwNjljMWFlOWNmNTQxMmI1ZmEwMGVlYWUzMmQzMWE=
12
12
  data.tar.gz: !binary |-
13
- ZGZiN2VmZTQ1N2FjMzczY2QxOGUzMzM1ZGJjOGEyZTVhMjdkYjU1ZjhiOWY4
14
- YWMyZjA4YzdjMTViY2EwMTgzZGFkZjUwODE1NzcxNjZiYTQwMmFkZDBmNGFi
15
- ODQ5Nzc1ZTQ4ODg0ZGE1Y2IwZWM0NjVlZmViMjI1ZTVkZDk0Njg=
13
+ NTAyN2Q2NGMxNDhmNGQzZjIzNTI3OTVkNjg2NDg2MDcxYWIyZTRmMjUxYWM5
14
+ MDM4Y2UzY2U1NWY4OWU1NDMzMzg4ZTMwYjYwYzQ3ZTU1MDJmODFkYTMwY2Nh
15
+ ODUxYzA5NmEwODM1MzUyYzgwNDkxZjZlNzY3ZGI2ZTViN2YyNzU=
@@ -18,7 +18,9 @@ module Rooler
18
18
  klass = klass_name.to_s.classify.constantize
19
19
  add_nodes_to_tree(tree, liquid_methods(klass))
20
20
  associations(klass).each do |association|
21
- add_liquid_methods_as_nodes(tree[association.name.to_sym], association.class_name)
21
+ unless tree.parentage && tree.parentage.map(&:name).include?(association.name.to_s)
22
+ add_liquid_methods_as_nodes(tree[association.name.to_sym], association.class_name)
23
+ end
22
24
  end
23
25
  return tree
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Rooler
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -2,6 +2,6 @@ class Bar < ActiveRecord::Base
2
2
  belongs_to :foo
3
3
  has_one :raboof
4
4
 
5
- liquid_methods :test, :raboof
5
+ liquid_methods :test, :raboof, :foo
6
6
 
7
7
  end
@@ -47675,3 +47675,2514 @@ RoolerTest: test_resets_resetable_deliveries
47675
47675
   (0.1ms) RELEASE SAVEPOINT active_record_1
47676
47676
   (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47677
47677
   (0.1ms) ROLLBACK
47678
+  (0.2ms) BEGIN
47679
+ ----------------------------------------
47680
+ Rooler::DeliveryMailerTest: test_deliver
47681
+ ----------------------------------------
47682
+  (0.2ms) SAVEPOINT active_record_1
47683
+ SQL (36.9ms) 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 16:27:39 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47684
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47685
+  (0.2ms) SAVEPOINT active_record_1
47686
+ SQL (1.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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 421], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47687
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47688
+  (0.2ms) SAVEPOINT active_record_1
47689
+ Rooler::Delivery Exists (11.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 379 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 379) LIMIT 1
47690
+ SQL (1.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 16:27:39 UTC +00:00], ["deliverable_id", 379], ["deliverable_type", "Rooler::Rule"], ["rule_id", 379], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47691
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47692
+ 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", 379]]
47693
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (18.8ms)
47694
+
47695
+ Sent mail to test_name@to.com (84.7ms)
47696
+ Date: Fri, 28 Mar 2014 17:27:39 +0100
47697
+ From: default@myapp.com
47698
+ To: test_name@to.com
47699
+ Cc: test_name@cc.com
47700
+ Message-ID: <5335a2fb73cd3_186683ff042034cd4779e9@Yonahs-MacBook-Pro.local.mail>
47701
+ Subject: subject is: test_name
47702
+ Mime-Version: 1.0
47703
+ Content-Type: text/html;
47704
+ charset=UTF-8
47705
+ Content-Transfer-Encoding: 7bit
47706
+
47707
+ body is: test_name
47708
+  (0.4ms) ROLLBACK
47709
+  (0.2ms) BEGIN
47710
+ ---------------------------------------------------------------------------------------
47711
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
47712
+ ---------------------------------------------------------------------------------------
47713
+  (0.2ms) SAVEPOINT active_record_1
47714
+ SQL (1.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47715
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47716
+  (0.1ms) SAVEPOINT active_record_1
47717
+ 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-1"], ["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47718
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47719
+  (0.1ms) SAVEPOINT active_record_1
47720
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 422], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47721
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47722
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
47723
+  (0.1ms) SAVEPOINT active_record_1
47724
+ 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 16:27:39 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47725
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47726
+  (0.2ms) SAVEPOINT active_record_1
47727
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 423], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47728
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47729
+  (0.2ms) ROLLBACK
47730
+  (0.1ms) BEGIN
47731
+ ------------------------------------------------------------------------------
47732
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
47733
+ ------------------------------------------------------------------------------
47734
+  (0.1ms) SAVEPOINT active_record_1
47735
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47736
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47737
+  (0.1ms) SAVEPOINT active_record_1
47738
+ 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 16:27:39 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47739
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47740
+  (0.1ms) SAVEPOINT active_record_1
47741
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 424], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47742
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47743
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47744
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]]
47745
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47746
+  (0.1ms) SAVEPOINT active_record_1
47747
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 382 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 254) LIMIT 1
47748
+ 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 16:27:39 UTC +00:00], ["deliverable_id", 254], ["deliverable_type", "Foo"], ["rule_id", 382], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47749
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47750
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.573393' WHERE "rooler_rules"."id" = 382
47751
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47752
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47753
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]]
47754
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (254))
47755
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.577950' WHERE "rooler_rules"."id" = 382
47756
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47757
+  (0.2ms) ROLLBACK
47758
+  (0.2ms) BEGIN
47759
+ --------------------------------------------------------------------------------------------------------
47760
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
47761
+ --------------------------------------------------------------------------------------------------------
47762
+  (0.3ms) SAVEPOINT active_record_1
47763
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47764
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47765
+  (0.2ms) SAVEPOINT active_record_1
47766
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47767
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47768
+  (0.2ms) SAVEPOINT active_record_1
47769
+ 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-4"], ["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47770
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47771
+  (0.1ms) SAVEPOINT active_record_1
47772
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 425], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47773
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47774
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" LIMIT 1
47775
+  (0.1ms) ROLLBACK
47776
+  (0.1ms) BEGIN
47777
+ --------------------------------------------------------------------------------------------------------------------------------------
47778
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
47779
+ --------------------------------------------------------------------------------------------------------------------------------------
47780
+  (0.1ms) SAVEPOINT active_record_1
47781
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47782
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47783
+  (0.2ms) SAVEPOINT active_record_1
47784
+ 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 16:27:39 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47785
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47786
+  (0.1ms) SAVEPOINT active_record_1
47787
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 426], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47788
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47789
+  (0.2ms) SAVEPOINT active_record_1
47790
+ 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 16:27:39 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47791
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47792
+  (0.1ms) SAVEPOINT active_record_1
47793
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 427], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47794
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47795
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]]
47796
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
47797
+  (0.1ms) SAVEPOINT active_record_1
47798
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 384 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 257) LIMIT 1
47799
+ 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 16:27:39 UTC +00:00], ["deliverable_id", 257], ["deliverable_type", "Foo"], ["rule_id", 384], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47800
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47801
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.646057' WHERE "rooler_rules"."id" = 384
47802
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
47803
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 385]]
47804
+  (0.2ms) SAVEPOINT active_record_1
47805
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 385 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 257) LIMIT 1
47806
+ 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 16:27:39 UTC +00:00], ["deliverable_id", 257], ["deliverable_type", "Foo"], ["rule_id", 385], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47807
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47808
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.653331' WHERE "rooler_rules"."id" = 385
47809
+  (0.1ms) SAVEPOINT active_record_1
47810
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47811
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47812
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 384]]
47813
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]]
47814
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (257))
47815
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 385]]
47816
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
47817
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 385]]
47818
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 385]]
47819
+  (0.2ms) ROLLBACK
47820
+  (0.3ms) BEGIN
47821
+ ----------------------------------------------------------------------------------------------------
47822
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
47823
+ ----------------------------------------------------------------------------------------------------
47824
+  (0.2ms) SAVEPOINT active_record_1
47825
+ 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 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47826
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47827
+  (0.1ms) SAVEPOINT active_record_1
47828
+ 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 16:27:39 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47829
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47830
+  (0.1ms) SAVEPOINT active_record_1
47831
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 428], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47832
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47833
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]]
47834
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47835
+  (0.3ms) SAVEPOINT active_record_1
47836
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 386 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 259) LIMIT 1
47837
+ 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 16:27:39 UTC +00:00], ["deliverable_id", 259], ["deliverable_type", "Foo"], ["rule_id", 386], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47838
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47839
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.688961' WHERE "rooler_rules"."id" = 386
47840
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]]
47841
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (259))
47842
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47843
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]]
47844
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (259))
47845
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.695937' WHERE "rooler_rules"."id" = 386
47846
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47847
+  (0.1ms) SAVEPOINT active_record_1
47848
+ SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 259 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47849
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47850
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47851
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]]
47852
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
47853
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (259) [["rule_id", 386]]
47854
+  (0.2ms) SAVEPOINT active_record_1
47855
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 194]]
47856
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47857
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
47858
+  (0.1ms) SAVEPOINT active_record_1
47859
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 259 [["active", true], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47860
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47861
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47862
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]]
47863
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
47864
+  (0.1ms) SAVEPOINT active_record_1
47865
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 386 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 259) LIMIT 1
47866
+ 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 16:27:39 UTC +00:00], ["deliverable_id", 259], ["deliverable_type", "Foo"], ["rule_id", 386], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47867
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47868
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.719343' WHERE "rooler_rules"."id" = 386
47869
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
47870
+  (0.1ms) ROLLBACK
47871
+  (0.1ms) BEGIN
47872
+ -------------------------------------------------------------------------------------------------------------------------
47873
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
47874
+ -------------------------------------------------------------------------------------------------------------------------
47875
+  (0.2ms) SAVEPOINT active_record_1
47876
+ 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 16:27:39 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47877
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47878
+  (0.1ms) SAVEPOINT active_record_1
47879
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:18:39 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 429], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47880
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47881
+  (0.1ms) SAVEPOINT active_record_1
47882
+ 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 16:27:39 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47883
+  (0.3ms) RELEASE SAVEPOINT active_record_1
47884
+  (0.2ms) SAVEPOINT active_record_1
47885
+ SQL (1.2ms) 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:16:39 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 430], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47886
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47887
+  (0.2ms) SAVEPOINT active_record_1
47888
+ 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 16:27:39 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47889
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47890
+  (0.1ms) SAVEPOINT active_record_1
47891
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 431], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47892
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47893
+  (0.1ms) SAVEPOINT active_record_1
47894
+ 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 16:27:39 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47895
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47896
+  (0.1ms) SAVEPOINT active_record_1
47897
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 432], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47898
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47899
+ 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())
47900
+  (0.2ms) ROLLBACK
47901
+  (0.1ms) BEGIN
47902
+ ---------------------------------------------------------------------------------------
47903
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
47904
+ ---------------------------------------------------------------------------------------
47905
+  (0.1ms) SAVEPOINT active_record_1
47906
+ 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 16:27:39 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47907
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47908
+  (0.2ms) SAVEPOINT active_record_1
47909
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
47910
+  (0.2ms) SAVEPOINT active_record_1
47911
+ 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 16:27:39 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47912
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47913
+  (0.2ms) SAVEPOINT active_record_1
47914
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
47915
+  (0.2ms) ROLLBACK
47916
+  (0.1ms) BEGIN
47917
+ --------------------------------------------------------------------------
47918
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
47919
+ --------------------------------------------------------------------------
47920
+  (0.2ms) SAVEPOINT active_record_1
47921
+ 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 16:27:39 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47922
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47923
+  (0.1ms) SAVEPOINT active_record_1
47924
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 435], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47925
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47926
+ Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 435]]
47927
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47928
+  (0.1ms) SAVEPOINT active_record_1
47929
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47930
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47931
+  (0.2ms) SAVEPOINT active_record_1
47932
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47933
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47934
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47935
+  (0.2ms) ROLLBACK
47936
+  (0.2ms) BEGIN
47937
+ ----------------------------------------------------------------------------------
47938
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
47939
+ ----------------------------------------------------------------------------------
47940
+  (0.2ms) SAVEPOINT active_record_1
47941
+ 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 16:27:39 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47942
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47943
+  (0.1ms) SAVEPOINT active_record_1
47944
+ 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 16:27:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 436], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47945
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47946
+  (0.2ms) SAVEPOINT active_record_1
47947
+ SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:27:39 UTC +00:00]]
47948
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47949
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 436]]
47950
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
47951
+  (0.1ms) BEGIN
47952
+ ----------------------------------------
47953
+ Rooler::DeliveryMailerTest: test_deliver
47954
+ ----------------------------------------
47955
+  (0.2ms) SAVEPOINT active_record_1
47956
+ SQL (38.9ms) 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 16:29:16 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 16:29:16 UTC +00:00]]
47957
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47958
+  (0.2ms) SAVEPOINT active_record_1
47959
+ 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 16:29:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 437], ["updated_at", Fri, 28 Mar 2014 16:29:16 UTC +00:00]]
47960
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47961
+  (0.3ms) SAVEPOINT active_record_1
47962
+ Rooler::Delivery Exists (1.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 393 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 393) LIMIT 1
47963
+ SQL (1.3ms) 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 16:29:17 UTC +00:00], ["deliverable_id", 393], ["deliverable_type", "Rooler::Rule"], ["rule_id", 393], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
47964
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47965
+ 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", 393]]
47966
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.5ms)
47967
+
47968
+ Sent mail to test_name@to.com (83.1ms)
47969
+ Date: Fri, 28 Mar 2014 17:29:17 +0100
47970
+ From: default@myapp.com
47971
+ To: test_name@to.com
47972
+ Cc: test_name@cc.com
47973
+ Message-ID: <5335a35d47a91_983fd521c34cdc31888@Yonahs-MacBook-Pro.local.mail>
47974
+ Subject: subject is: test_name
47975
+ Mime-Version: 1.0
47976
+ Content-Type: text/html;
47977
+ charset=UTF-8
47978
+ Content-Transfer-Encoding: 7bit
47979
+
47980
+ body is: test_name
47981
+  (0.4ms) ROLLBACK
47982
+  (0.2ms) BEGIN
47983
+ ---------------------------------------------------------------------------------------
47984
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
47985
+ ---------------------------------------------------------------------------------------
47986
+  (0.3ms) SAVEPOINT active_record_1
47987
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
47988
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47989
+  (0.1ms) SAVEPOINT active_record_1
47990
+ 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 16:29:17 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
47991
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47992
+  (0.1ms) SAVEPOINT active_record_1
47993
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 438], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
47994
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47995
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
47996
+  (0.1ms) SAVEPOINT active_record_1
47997
+ 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 16:29:17 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
47998
+  (0.1ms) RELEASE SAVEPOINT active_record_1
47999
+  (0.2ms) SAVEPOINT active_record_1
48000
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 439], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48001
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48002
+  (0.3ms) ROLLBACK
48003
+  (0.1ms) BEGIN
48004
+ ------------------------------------------------------------------------------
48005
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
48006
+ ------------------------------------------------------------------------------
48007
+  (0.1ms) SAVEPOINT active_record_1
48008
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48009
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48010
+  (0.2ms) SAVEPOINT active_record_1
48011
+ 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 16:29:17 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48012
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48013
+  (0.1ms) SAVEPOINT active_record_1
48014
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 440], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48015
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48016
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48017
+  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]]
48018
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48019
+  (0.1ms) SAVEPOINT active_record_1
48020
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 396 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 264) LIMIT 1
48021
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 264], ["deliverable_type", "Foo"], ["rule_id", 396], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48022
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48023
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.385541' WHERE "rooler_rules"."id" = 396
48024
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48025
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48026
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]]
48027
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (264))
48028
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.390709' WHERE "rooler_rules"."id" = 396
48029
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48030
+  (0.1ms) ROLLBACK
48031
+  (0.1ms) BEGIN
48032
+ --------------------------------------------------------------------------------------------------------
48033
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
48034
+ --------------------------------------------------------------------------------------------------------
48035
+  (0.1ms) SAVEPOINT active_record_1
48036
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48037
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48038
+  (0.1ms) SAVEPOINT active_record_1
48039
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48040
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48041
+  (0.2ms) SAVEPOINT active_record_1
48042
+ 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 16:29:17 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48043
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48044
+  (0.1ms) SAVEPOINT active_record_1
48045
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 441], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48046
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48047
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
48048
+  (0.1ms) ROLLBACK
48049
+  (0.2ms) BEGIN
48050
+ --------------------------------------------------------------------------------------------------------------------------------------
48051
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
48052
+ --------------------------------------------------------------------------------------------------------------------------------------
48053
+  (0.1ms) SAVEPOINT active_record_1
48054
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48055
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48056
+  (0.1ms) SAVEPOINT active_record_1
48057
+ 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 16:29:17 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48058
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48059
+  (0.1ms) SAVEPOINT active_record_1
48060
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 442], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48061
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48062
+  (0.1ms) SAVEPOINT active_record_1
48063
+ 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 16:29:17 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48064
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48065
+  (0.2ms) SAVEPOINT active_record_1
48066
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 443], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48067
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48068
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]]
48069
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48070
+  (0.1ms) SAVEPOINT active_record_1
48071
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 398 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 267) LIMIT 1
48072
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 267], ["deliverable_type", "Foo"], ["rule_id", 398], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48073
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48074
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.445821' WHERE "rooler_rules"."id" = 398
48075
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
48076
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]
48077
+  (0.1ms) SAVEPOINT active_record_1
48078
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 399 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 267) LIMIT 1
48079
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 267], ["deliverable_type", "Foo"], ["rule_id", 399], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48080
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48081
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.453266' WHERE "rooler_rules"."id" = 399
48082
+  (0.1ms) SAVEPOINT active_record_1
48083
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48084
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48085
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]]
48086
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]]
48087
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (267))
48088
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 399]]
48089
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
48090
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]
48091
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]
48092
+  (0.2ms) ROLLBACK
48093
+  (0.3ms) BEGIN
48094
+ ----------------------------------------------------------------------------------------------------
48095
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
48096
+ ----------------------------------------------------------------------------------------------------
48097
+  (0.2ms) SAVEPOINT active_record_1
48098
+ 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 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48099
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48100
+  (0.2ms) SAVEPOINT active_record_1
48101
+ 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 16:29:17 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48102
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48103
+  (0.1ms) SAVEPOINT active_record_1
48104
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 444], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48105
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48106
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]
48107
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48108
+  (0.1ms) SAVEPOINT active_record_1
48109
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 400 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 269) LIMIT 1
48110
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 269], ["deliverable_type", "Foo"], ["rule_id", 400], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48111
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48112
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.488740' WHERE "rooler_rules"."id" = 400
48113
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]
48114
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (269))
48115
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48116
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]
48117
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (269))
48118
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.494983' WHERE "rooler_rules"."id" = 400
48119
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48120
+  (0.2ms) SAVEPOINT active_record_1
48121
+ SQL (1.2ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 269 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48122
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48123
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
48124
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]
48125
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
48126
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (269) [["rule_id", 400]]
48127
+  (0.2ms) SAVEPOINT active_record_1
48128
+ SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 200]]
48129
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48130
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48131
+  (0.1ms) SAVEPOINT active_record_1
48132
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 269 [["active", true], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48133
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48134
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48135
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]
48136
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48137
+  (0.1ms) SAVEPOINT active_record_1
48138
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 400 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 269) LIMIT 1
48139
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 269], ["deliverable_type", "Foo"], ["rule_id", 400], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48140
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48141
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.524576' WHERE "rooler_rules"."id" = 400
48142
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48143
+  (0.1ms) ROLLBACK
48144
+  (0.2ms) BEGIN
48145
+ -------------------------------------------------------------------------------------------------------------------------
48146
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
48147
+ -------------------------------------------------------------------------------------------------------------------------
48148
+  (0.1ms) SAVEPOINT active_record_1
48149
+ 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 16:29:17 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48150
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48151
+  (0.1ms) SAVEPOINT active_record_1
48152
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:20:17 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 445], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48153
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48154
+  (0.1ms) SAVEPOINT active_record_1
48155
+ 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 16:29:17 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48156
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48157
+  (0.2ms) SAVEPOINT active_record_1
48158
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:18:17 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 446], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48159
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48160
+  (0.2ms) SAVEPOINT active_record_1
48161
+ 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 16:29:17 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48162
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48163
+  (0.1ms) SAVEPOINT active_record_1
48164
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 447], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48166
+  (0.1ms) SAVEPOINT active_record_1
48167
+ 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 16:29:17 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48168
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48169
+  (0.1ms) SAVEPOINT active_record_1
48170
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 448], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48171
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48172
+ 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())
48173
+  (0.1ms) ROLLBACK
48174
+  (0.1ms) BEGIN
48175
+ ---------------------------------------------------------------------------------------
48176
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
48177
+ ---------------------------------------------------------------------------------------
48178
+  (0.1ms) SAVEPOINT active_record_1
48179
+ 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 16:29:17 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48180
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48181
+  (0.2ms) SAVEPOINT active_record_1
48182
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
48183
+  (0.1ms) SAVEPOINT active_record_1
48184
+ 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 16:29:17 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48185
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48186
+  (0.1ms) SAVEPOINT active_record_1
48187
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
48188
+  (0.1ms) ROLLBACK
48189
+  (0.1ms) BEGIN
48190
+ --------------------------------------------------------------------------
48191
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
48192
+ --------------------------------------------------------------------------
48193
+  (0.1ms) SAVEPOINT active_record_1
48194
+ 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 16:29:17 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48195
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48196
+  (0.1ms) SAVEPOINT active_record_1
48197
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 451], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48198
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48199
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 451]]
48200
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48201
+  (0.1ms) SAVEPOINT active_record_1
48202
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48203
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48204
+  (0.1ms) SAVEPOINT active_record_1
48205
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48206
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48207
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48208
+  (0.2ms) ROLLBACK
48209
+  (0.1ms) BEGIN
48210
+ ----------------------------------------------------------------------------------
48211
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
48212
+ ----------------------------------------------------------------------------------
48213
+  (0.2ms) SAVEPOINT active_record_1
48214
+ 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 16:29:17 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48215
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48216
+  (0.1ms) SAVEPOINT active_record_1
48217
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 452], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48218
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48219
+  (0.1ms) SAVEPOINT active_record_1
48220
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48221
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48222
+ Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 452]]
48223
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48224
+  (0.2ms) ROLLBACK
48225
+  (0.2ms) BEGIN
48226
+ ----------------------------------------
48227
+ RoolerTest: test_delivers_pending_emails
48228
+ ----------------------------------------
48229
+  (0.2ms) SAVEPOINT active_record_1
48230
+ 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 16:29:17 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48231
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48232
+  (0.1ms) SAVEPOINT active_record_1
48233
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 453], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48234
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48235
+  (0.1ms) SAVEPOINT active_record_1
48236
+ 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 16:29:17 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48237
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48238
+  (0.1ms) SAVEPOINT active_record_1
48239
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 454], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48240
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48241
+  (0.1ms) SAVEPOINT active_record_1
48242
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 407 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 408) LIMIT 1
48243
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 408], ["deliverable_type", "Rooler::Rule"], ["rule_id", 407], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48244
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48245
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
48246
+ 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", 407]]
48247
+ 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", 408]]
48248
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
48249
+
48250
+ Sent mail to test@email.com (14.9ms)
48251
+ Date: Fri, 28 Mar 2014 17:29:17 +0100
48252
+ From: default@myapp.com
48253
+ To: test@email.com
48254
+ Message-ID: <5335a35dbb932_983fd521c34cdc319dc@Yonahs-MacBook-Pro.local.mail>
48255
+ Subject: subject-16
48256
+ Mime-Version: 1.0
48257
+ Content-Type: text/html;
48258
+ charset=UTF-8
48259
+ Content-Transfer-Encoding: 7bit
48260
+
48261
+ body-16
48262
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:29:17.781247' WHERE "rooler_deliveries"."id" = 202
48263
+ Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 202]]
48264
+  (0.2ms) ROLLBACK
48265
+  (0.2ms) BEGIN
48266
+ ------------------------------------------
48267
+ RoolerTest: test_processes_scheduled_rules
48268
+ ------------------------------------------
48269
+  (0.2ms) SAVEPOINT active_record_1
48270
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48271
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48272
+  (0.1ms) SAVEPOINT active_record_1
48273
+ 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 16:29:17 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48274
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48275
+  (0.1ms) SAVEPOINT active_record_1
48276
+ SQL (0.4ms) 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 455], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48277
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48278
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48279
+ 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())
48280
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]]
48281
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48282
+  (0.1ms) SAVEPOINT active_record_1
48283
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 409 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 273) LIMIT 1
48284
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 273], ["deliverable_type", "Foo"], ["rule_id", 409], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48285
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48286
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.861255' WHERE "rooler_rules"."id" = 409
48287
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
48288
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
48289
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 273]]
48290
+  (0.2ms) ROLLBACK
48291
+  (0.2ms) BEGIN
48292
+ --------------------------------------------
48293
+ RoolerTest: test_resets_resetable_deliveries
48294
+ --------------------------------------------
48295
+  (0.1ms) SAVEPOINT active_record_1
48296
+ 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 16:29:17 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48297
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48298
+  (0.2ms) SAVEPOINT active_record_1
48299
+ 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 16:29:17 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48300
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48301
+  (0.1ms) SAVEPOINT active_record_1
48302
+ 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 16:29:17 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 456], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48303
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48304
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 410]]
48305
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48306
+  (0.1ms) SAVEPOINT active_record_1
48307
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 410 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 274) LIMIT 1
48308
+ 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 16:29:17 UTC +00:00], ["deliverable_id", 274], ["deliverable_type", "Foo"], ["rule_id", 410], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48309
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48310
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.888827' WHERE "rooler_rules"."id" = 410
48311
+  (0.1ms) SAVEPOINT active_record_1
48312
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 274 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:29:17 UTC +00:00]]
48313
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48314
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
48315
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"
48316
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 410]]
48317
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
48318
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (274) [["rule_id", 410]]
48319
+  (0.2ms) SAVEPOINT active_record_1
48320
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 204]]
48321
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48322
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48323
+  (0.1ms) ROLLBACK
48324
+  (0.1ms) BEGIN
48325
+ ----------------------------------------
48326
+ Rooler::DeliveryMailerTest: test_deliver
48327
+ ----------------------------------------
48328
+  (0.3ms) SAVEPOINT active_record_1
48329
+ SQL (21.6ms) 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 16:31:04 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48330
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48331
+  (0.2ms) SAVEPOINT active_record_1
48332
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 457], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48333
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48334
+  (0.2ms) SAVEPOINT active_record_1
48335
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 411 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 411) LIMIT 1
48336
+ 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 16:31:04 UTC +00:00], ["deliverable_id", 411], ["deliverable_type", "Rooler::Rule"], ["rule_id", 411], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48337
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48338
+ 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", 411]]
48339
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (4.2ms)
48340
+
48341
+ Sent mail to test_name@to.com (96.0ms)
48342
+ Date: Fri, 28 Mar 2014 17:31:04 +0100
48343
+ From: default@myapp.com
48344
+ To: test_name@to.com
48345
+ Cc: test_name@cc.com
48346
+ Message-ID: <5335a3c8c58df_1423fef88434ce0829fc@Yonahs-MacBook-Pro.local.mail>
48347
+ Subject: subject is: test_name
48348
+ Mime-Version: 1.0
48349
+ Content-Type: text/html;
48350
+ charset=UTF-8
48351
+ Content-Transfer-Encoding: 7bit
48352
+
48353
+ body is: test_name
48354
+  (0.3ms) ROLLBACK
48355
+  (0.3ms) BEGIN
48356
+ ---------------------------------------------------------------------------------------
48357
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
48358
+ ---------------------------------------------------------------------------------------
48359
+  (0.1ms) SAVEPOINT active_record_1
48360
+ SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48361
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48362
+  (0.2ms) SAVEPOINT active_record_1
48363
+ SQL (1.2ms) 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 16:31:04 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48364
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48365
+  (0.2ms) SAVEPOINT active_record_1
48366
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 458], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48367
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48368
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
48369
+  (0.1ms) SAVEPOINT active_record_1
48370
+ 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 16:31:04 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48371
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48372
+  (0.1ms) SAVEPOINT active_record_1
48373
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 459], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48374
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48375
+  (0.2ms) ROLLBACK
48376
+  (0.1ms) BEGIN
48377
+ ------------------------------------------------------------------------------
48378
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
48379
+ ------------------------------------------------------------------------------
48380
+  (0.1ms) SAVEPOINT active_record_1
48381
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48382
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48383
+  (0.2ms) SAVEPOINT active_record_1
48384
+ 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 16:31:04 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48385
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48386
+  (0.1ms) SAVEPOINT active_record_1
48387
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 460], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48388
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48389
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48390
+  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 414]]
48391
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48392
+  (0.1ms) SAVEPOINT active_record_1
48393
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 414 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 276) LIMIT 1
48394
+ 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 16:31:04 UTC +00:00], ["deliverable_id", 276], ["deliverable_type", "Foo"], ["rule_id", 414], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48395
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48396
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.902590' WHERE "rooler_rules"."id" = 414
48397
+  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"
48398
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
48399
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 414]]
48400
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (276))
48401
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.909273' WHERE "rooler_rules"."id" = 414
48402
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48403
+  (0.1ms) ROLLBACK
48404
+  (0.2ms) BEGIN
48405
+ --------------------------------------------------------------------------------------------------------
48406
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
48407
+ --------------------------------------------------------------------------------------------------------
48408
+  (0.2ms) SAVEPOINT active_record_1
48409
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48410
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48411
+  (0.2ms) SAVEPOINT active_record_1
48412
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48413
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48414
+  (0.2ms) SAVEPOINT active_record_1
48415
+ 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-4"], ["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48416
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48417
+  (0.1ms) SAVEPOINT active_record_1
48418
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 461], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48419
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48420
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1
48421
+  (0.3ms) ROLLBACK
48422
+  (0.3ms) BEGIN
48423
+ --------------------------------------------------------------------------------------------------------------------------------------
48424
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
48425
+ --------------------------------------------------------------------------------------------------------------------------------------
48426
+  (0.2ms) SAVEPOINT active_record_1
48427
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48428
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48429
+  (0.2ms) SAVEPOINT active_record_1
48430
+ 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-5"], ["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48431
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48432
+  (0.2ms) SAVEPOINT active_record_1
48433
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 462], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48434
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48435
+  (0.2ms) SAVEPOINT active_record_1
48436
+ 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 16:31:04 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48437
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48438
+  (0.2ms) SAVEPOINT active_record_1
48439
+ 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 16:31:04 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 463], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48440
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48441
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]]
48442
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48443
+  (0.1ms) SAVEPOINT active_record_1
48444
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 416 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 279) LIMIT 1
48445
+ 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 16:31:04 UTC +00:00], ["deliverable_id", 279], ["deliverable_type", "Foo"], ["rule_id", 416], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48446
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48447
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.981176' WHERE "rooler_rules"."id" = 416
48448
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
48449
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]
48450
+  (0.1ms) SAVEPOINT active_record_1
48451
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 417 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 279) LIMIT 1
48452
+ 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 16:31:04 UTC +00:00], ["deliverable_id", 279], ["deliverable_type", "Foo"], ["rule_id", 417], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48453
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48454
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.990216' WHERE "rooler_rules"."id" = 417
48455
+  (0.2ms) SAVEPOINT active_record_1
48456
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:04 UTC +00:00]]
48457
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48458
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 416]]
48459
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]]
48460
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (279))
48461
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 417]]
48462
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
48463
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]
48464
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]
48465
+  (0.1ms) ROLLBACK
48466
+  (0.1ms) BEGIN
48467
+ ----------------------------------------------------------------------------------------------------
48468
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
48469
+ ----------------------------------------------------------------------------------------------------
48470
+  (0.1ms) SAVEPOINT active_record_1
48471
+ 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 16:31:05 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48472
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48473
+  (0.1ms) SAVEPOINT active_record_1
48474
+ 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 16:31:05 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48475
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48476
+  (0.1ms) SAVEPOINT active_record_1
48477
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 464], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48478
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48479
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]]
48480
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48481
+  (0.1ms) SAVEPOINT active_record_1
48482
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 418 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 281) LIMIT 1
48483
+ 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 16:31:05 UTC +00:00], ["deliverable_id", 281], ["deliverable_type", "Foo"], ["rule_id", 418], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48484
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48485
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.023153' WHERE "rooler_rules"."id" = 418
48486
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]]
48487
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (281))
48488
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48489
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]]
48490
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (281))
48491
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.028308' WHERE "rooler_rules"."id" = 418
48492
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48493
+  (0.2ms) SAVEPOINT active_record_1
48494
+ SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 281 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48495
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48496
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48497
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]]
48498
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
48499
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (281) [["rule_id", 418]]
48500
+  (0.2ms) SAVEPOINT active_record_1
48501
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 209]]
48502
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48503
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48504
+  (0.1ms) SAVEPOINT active_record_1
48505
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 281 [["active", true], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48506
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48507
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48508
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]]
48509
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48510
+  (0.2ms) SAVEPOINT active_record_1
48511
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 418 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 281) LIMIT 1
48512
+ 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 16:31:05 UTC +00:00], ["deliverable_id", 281], ["deliverable_type", "Foo"], ["rule_id", 418], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48513
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48514
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.059034' WHERE "rooler_rules"."id" = 418
48515
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48516
+  (0.2ms) ROLLBACK
48517
+  (0.2ms) BEGIN
48518
+ -------------------------------------------------------------------------------------------------------------------------
48519
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
48520
+ -------------------------------------------------------------------------------------------------------------------------
48521
+  (0.1ms) SAVEPOINT active_record_1
48522
+ 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 16:31:05 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48523
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48524
+  (0.1ms) SAVEPOINT active_record_1
48525
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:22:05 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 465], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48526
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48527
+  (0.1ms) SAVEPOINT active_record_1
48528
+ 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 16:31:05 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48529
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48530
+  (0.1ms) SAVEPOINT active_record_1
48531
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:20:05 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 466], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48532
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48533
+  (0.1ms) SAVEPOINT active_record_1
48534
+ 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 16:31:05 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48535
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48536
+  (0.1ms) SAVEPOINT active_record_1
48537
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 467], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48538
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48539
+  (0.1ms) SAVEPOINT active_record_1
48540
+ 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 16:31:05 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48541
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48542
+  (0.1ms) SAVEPOINT active_record_1
48543
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 468], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48544
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48545
+ 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())
48546
+  (0.1ms) ROLLBACK
48547
+  (0.1ms) BEGIN
48548
+ ---------------------------------------------------------------------------------------
48549
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
48550
+ ---------------------------------------------------------------------------------------
48551
+  (0.1ms) SAVEPOINT active_record_1
48552
+ 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 16:31:05 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48553
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48554
+  (0.1ms) SAVEPOINT active_record_1
48555
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
48556
+  (0.1ms) SAVEPOINT active_record_1
48557
+ 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 16:31:05 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48558
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48559
+  (0.3ms) SAVEPOINT active_record_1
48560
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
48561
+  (0.2ms) ROLLBACK
48562
+  (0.2ms) BEGIN
48563
+ --------------------------------------------------------------------------
48564
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
48565
+ --------------------------------------------------------------------------
48566
+  (0.2ms) SAVEPOINT active_record_1
48567
+ 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 16:31:05 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48568
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48569
+  (0.2ms) SAVEPOINT active_record_1
48570
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 471], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48571
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48572
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 471]]
48573
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48574
+  (0.1ms) SAVEPOINT active_record_1
48575
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48576
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48577
+  (0.2ms) SAVEPOINT active_record_1
48578
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48579
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48580
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48581
+  (0.2ms) ROLLBACK
48582
+  (0.2ms) BEGIN
48583
+ ----------------------------------------------------------------------------------
48584
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
48585
+ ----------------------------------------------------------------------------------
48586
+  (0.1ms) SAVEPOINT active_record_1
48587
+ 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 16:31:05 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48588
+  (0.3ms) RELEASE SAVEPOINT active_record_1
48589
+  (0.2ms) SAVEPOINT active_record_1
48590
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 472], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48591
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48592
+  (0.2ms) SAVEPOINT active_record_1
48593
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48594
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48595
+  (0.3ms) ROLLBACK
48596
+  (0.2ms) BEGIN
48597
+ ----------------------------------------
48598
+ RoolerTest: test_delivers_pending_emails
48599
+ ----------------------------------------
48600
+  (0.2ms) SAVEPOINT active_record_1
48601
+ 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 16:31:05 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48602
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48603
+  (0.1ms) SAVEPOINT active_record_1
48604
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 473], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48605
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48606
+  (0.1ms) SAVEPOINT active_record_1
48607
+ 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 16:31:05 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48608
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48609
+  (0.1ms) SAVEPOINT active_record_1
48610
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 474], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48611
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48612
+  (0.1ms) SAVEPOINT active_record_1
48613
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 425 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 426) LIMIT 1
48614
+ 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 16:31:05 UTC +00:00], ["deliverable_id", 426], ["deliverable_type", "Rooler::Rule"], ["rule_id", 425], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48615
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48616
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
48617
+ 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", 425]]
48618
+ 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", 426]]
48619
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
48620
+
48621
+ Sent mail to test@email.com (16.8ms)
48622
+ Date: Fri, 28 Mar 2014 17:31:05 +0100
48623
+ From: default@myapp.com
48624
+ To: test@email.com
48625
+ Message-ID: <5335a3c94813a_1423fef88434ce083042@Yonahs-MacBook-Pro.local.mail>
48626
+ Subject: subject-16
48627
+ Mime-Version: 1.0
48628
+ Content-Type: text/html;
48629
+ charset=UTF-8
48630
+ Content-Transfer-Encoding: 7bit
48631
+
48632
+ body-16
48633
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:31:05.308741' WHERE "rooler_deliveries"."id" = 211
48634
+ Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 211]]
48635
+  (0.2ms) ROLLBACK
48636
+  (0.1ms) BEGIN
48637
+ ------------------------------------------
48638
+ RoolerTest: test_processes_scheduled_rules
48639
+ ------------------------------------------
48640
+  (0.1ms) SAVEPOINT active_record_1
48641
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48642
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48643
+  (0.2ms) SAVEPOINT active_record_1
48644
+ 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 16:31:05 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48645
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48646
+  (0.1ms) SAVEPOINT active_record_1
48647
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 475], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48648
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48649
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48650
+ 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())
48651
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 427]]
48652
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48653
+  (0.1ms) SAVEPOINT active_record_1
48654
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 427 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 285) LIMIT 1
48655
+ 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 16:31:05 UTC +00:00], ["deliverable_id", 285], ["deliverable_type", "Foo"], ["rule_id", 427], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48656
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48657
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.333237' WHERE "rooler_rules"."id" = 427
48658
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
48659
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
48660
+ Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 285]]
48661
+  (0.3ms) ROLLBACK
48662
+  (0.2ms) BEGIN
48663
+ --------------------------------------------
48664
+ RoolerTest: test_resets_resetable_deliveries
48665
+ --------------------------------------------
48666
+  (0.2ms) SAVEPOINT active_record_1
48667
+ 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 16:31:05 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48668
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48669
+  (0.2ms) SAVEPOINT active_record_1
48670
+ 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 16:31:05 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48671
+  (58.9ms) RELEASE SAVEPOINT active_record_1
48672
+  (0.2ms) SAVEPOINT active_record_1
48673
+ 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 16:31:05 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 476], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48674
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48675
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 428]]
48676
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48677
+  (0.1ms) SAVEPOINT active_record_1
48678
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 428 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 286) LIMIT 1
48679
+ 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 16:31:05 UTC +00:00], ["deliverable_id", 286], ["deliverable_type", "Foo"], ["rule_id", 428], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48680
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48681
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.421263' WHERE "rooler_rules"."id" = 428
48682
+  (0.1ms) SAVEPOINT active_record_1
48683
+ SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 286 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:31:05 UTC +00:00]]
48684
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48685
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48686
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
48687
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 428]]
48688
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
48689
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (286) [["rule_id", 428]]
48690
+  (0.1ms) SAVEPOINT active_record_1
48691
+ SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 213]]
48692
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48693
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48694
+  (0.1ms) ROLLBACK
48695
+  (0.2ms) BEGIN
48696
+ ----------------------------------------
48697
+ Rooler::DeliveryMailerTest: test_deliver
48698
+ ----------------------------------------
48699
+  (0.2ms) SAVEPOINT active_record_1
48700
+ SQL (78.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 16:31:31 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48701
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48702
+  (0.3ms) SAVEPOINT active_record_1
48703
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 477], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48704
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48705
+  (0.4ms) SAVEPOINT active_record_1
48706
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 429 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 429) LIMIT 1
48707
+ 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 16:31:31 UTC +00:00], ["deliverable_id", 429], ["deliverable_type", "Rooler::Rule"], ["rule_id", 429], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48708
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48709
+ 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", 429]]
48710
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (10.4ms)
48711
+
48712
+ Sent mail to test_name@to.com (77.4ms)
48713
+ Date: Fri, 28 Mar 2014 17:31:31 +0100
48714
+ From: default@myapp.com
48715
+ To: test_name@to.com
48716
+ Cc: test_name@cc.com
48717
+ Message-ID: <5335a3e3b3288_1643fe1cdc34cd854011@Yonahs-MacBook-Pro.local.mail>
48718
+ Subject: subject is: test_name
48719
+ Mime-Version: 1.0
48720
+ Content-Type: text/html;
48721
+ charset=UTF-8
48722
+ Content-Transfer-Encoding: 7bit
48723
+
48724
+ body is: test_name
48725
+  (0.4ms) ROLLBACK
48726
+  (0.1ms) BEGIN
48727
+ ---------------------------------------------------------------------------------------
48728
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
48729
+ ---------------------------------------------------------------------------------------
48730
+  (0.1ms) SAVEPOINT active_record_1
48731
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48732
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48733
+  (0.1ms) SAVEPOINT active_record_1
48734
+ 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 16:31:31 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48735
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48736
+  (0.3ms) SAVEPOINT active_record_1
48737
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 478], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48738
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48739
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')
48740
+  (0.2ms) SAVEPOINT active_record_1
48741
+ 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 16:31:31 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48742
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48743
+  (0.1ms) SAVEPOINT active_record_1
48744
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 479], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48745
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48746
+  (0.2ms) ROLLBACK
48747
+  (0.1ms) BEGIN
48748
+ ------------------------------------------------------------------------------
48749
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
48750
+ ------------------------------------------------------------------------------
48751
+  (0.1ms) SAVEPOINT active_record_1
48752
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48753
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48754
+  (0.1ms) SAVEPOINT active_record_1
48755
+ 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 16:31:31 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48756
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48757
+  (0.1ms) SAVEPOINT active_record_1
48758
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 480], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48759
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48760
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48761
+  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]]
48762
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48763
+  (0.2ms) SAVEPOINT active_record_1
48764
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 432 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 288) LIMIT 1
48765
+ 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 16:31:31 UTC +00:00], ["deliverable_id", 288], ["deliverable_type", "Foo"], ["rule_id", 432], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48766
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48767
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.866416' WHERE "rooler_rules"."id" = 432
48768
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48769
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48770
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]]
48771
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (288))
48772
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.870753' WHERE "rooler_rules"."id" = 432
48773
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48774
+  (0.1ms) ROLLBACK
48775
+  (0.2ms) BEGIN
48776
+ --------------------------------------------------------------------------------------------------------
48777
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
48778
+ --------------------------------------------------------------------------------------------------------
48779
+  (0.2ms) SAVEPOINT active_record_1
48780
+ SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48781
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48782
+  (0.2ms) SAVEPOINT active_record_1
48783
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48784
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48785
+  (0.1ms) SAVEPOINT active_record_1
48786
+ 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-4"], ["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48787
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48788
+  (0.2ms) SAVEPOINT active_record_1
48789
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 481], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48790
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48791
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
48792
+  (0.1ms) ROLLBACK
48793
+  (0.2ms) BEGIN
48794
+ --------------------------------------------------------------------------------------------------------------------------------------
48795
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
48796
+ --------------------------------------------------------------------------------------------------------------------------------------
48797
+  (0.2ms) SAVEPOINT active_record_1
48798
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48799
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48800
+  (0.2ms) SAVEPOINT active_record_1
48801
+ 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 16:31:31 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48802
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48803
+  (0.1ms) SAVEPOINT active_record_1
48804
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 482], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48805
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48806
+  (0.2ms) SAVEPOINT active_record_1
48807
+ 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 16:31:31 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48808
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48809
+  (0.1ms) SAVEPOINT active_record_1
48810
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 483], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48811
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48812
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]]
48813
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
48814
+  (0.1ms) SAVEPOINT active_record_1
48815
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 434 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 291) LIMIT 1
48816
+ 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 16:31:31 UTC +00:00], ["deliverable_id", 291], ["deliverable_type", "Foo"], ["rule_id", 434], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48817
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48818
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.923491' WHERE "rooler_rules"."id" = 434
48819
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
48820
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 435]]
48821
+  (0.1ms) SAVEPOINT active_record_1
48822
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 435 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 291) LIMIT 1
48823
+ 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 16:31:31 UTC +00:00], ["deliverable_id", 291], ["deliverable_type", "Foo"], ["rule_id", 435], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48824
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48825
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.930649' WHERE "rooler_rules"."id" = 435
48826
+  (0.1ms) SAVEPOINT active_record_1
48827
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48828
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48829
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 434]]
48830
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]]
48831
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (291))
48832
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 435]]
48833
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
48834
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 435]]
48835
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 435]]
48836
+  (0.2ms) ROLLBACK
48837
+  (0.1ms) BEGIN
48838
+ ----------------------------------------------------------------------------------------------------
48839
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
48840
+ ----------------------------------------------------------------------------------------------------
48841
+  (0.1ms) SAVEPOINT active_record_1
48842
+ 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 16:31:31 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48843
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48844
+  (0.1ms) SAVEPOINT active_record_1
48845
+ 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 16:31:31 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48846
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48847
+  (0.1ms) SAVEPOINT active_record_1
48848
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 484], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48849
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48850
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]]
48851
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48852
+  (0.1ms) SAVEPOINT active_record_1
48853
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 436 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 293) LIMIT 1
48854
+ 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 16:31:31 UTC +00:00], ["deliverable_id", 293], ["deliverable_type", "Foo"], ["rule_id", 436], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48855
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48856
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.960857' WHERE "rooler_rules"."id" = 436
48857
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]]
48858
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (293))
48859
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48860
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]]
48861
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (293))
48862
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.966421' WHERE "rooler_rules"."id" = 436
48863
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48864
+  (0.1ms) SAVEPOINT active_record_1
48865
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 293 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48866
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48867
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48868
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]]
48869
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
48870
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (293) [["rule_id", 436]]
48871
+  (0.2ms) SAVEPOINT active_record_1
48872
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 218]]
48873
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48874
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48875
+  (0.1ms) SAVEPOINT active_record_1
48876
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 293 [["active", true], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48877
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48878
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
48879
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]]
48880
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
48881
+  (0.1ms) SAVEPOINT active_record_1
48882
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 436 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 293) LIMIT 1
48883
+ 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 16:31:31 UTC +00:00], ["deliverable_id", 293], ["deliverable_type", "Foo"], ["rule_id", 436], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48884
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48885
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.990331' WHERE "rooler_rules"."id" = 436
48886
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
48887
+  (0.1ms) ROLLBACK
48888
+  (0.1ms) BEGIN
48889
+ -------------------------------------------------------------------------------------------------------------------------
48890
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
48891
+ -------------------------------------------------------------------------------------------------------------------------
48892
+  (0.2ms) SAVEPOINT active_record_1
48893
+ 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 16:31:31 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48894
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48895
+  (0.1ms) SAVEPOINT active_record_1
48896
+ 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 16:31:31 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:22:31 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 485], ["updated_at", Fri, 28 Mar 2014 16:31:31 UTC +00:00]]
48897
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48898
+  (0.1ms) SAVEPOINT active_record_1
48899
+ 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 16:31:32 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48900
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48901
+  (0.1ms) SAVEPOINT active_record_1
48902
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:20:32 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 486], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48903
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48904
+  (0.1ms) SAVEPOINT active_record_1
48905
+ 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 16:31:32 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48906
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48907
+  (0.2ms) SAVEPOINT active_record_1
48908
+ SQL (1.1ms) 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 487], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48909
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48910
+  (0.2ms) SAVEPOINT active_record_1
48911
+ 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 16:31:32 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48912
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48913
+  (0.1ms) SAVEPOINT active_record_1
48914
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 488], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48915
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48916
+ 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())
48917
+  (0.1ms) ROLLBACK
48918
+  (0.1ms) BEGIN
48919
+ ---------------------------------------------------------------------------------------
48920
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
48921
+ ---------------------------------------------------------------------------------------
48922
+  (0.2ms) SAVEPOINT active_record_1
48923
+ 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 16:31:32 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48924
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48925
+  (0.2ms) SAVEPOINT active_record_1
48926
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
48927
+  (0.2ms) SAVEPOINT active_record_1
48928
+ 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-13"], ["created_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48929
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48930
+  (0.2ms) SAVEPOINT active_record_1
48931
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
48932
+  (0.1ms) ROLLBACK
48933
+  (0.1ms) BEGIN
48934
+ --------------------------------------------------------------------------
48935
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
48936
+ --------------------------------------------------------------------------
48937
+  (0.2ms) SAVEPOINT active_record_1
48938
+ 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 16:31:32 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48939
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48940
+  (0.2ms) SAVEPOINT active_record_1
48941
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 491], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48942
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48943
+ Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 491]]
48944
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48945
+  (0.1ms) SAVEPOINT active_record_1
48946
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48947
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48948
+  (0.2ms) SAVEPOINT active_record_1
48949
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48950
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48951
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48952
+  (0.3ms) ROLLBACK
48953
+  (0.1ms) BEGIN
48954
+ ----------------------------------------------------------------------------------
48955
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
48956
+ ----------------------------------------------------------------------------------
48957
+  (0.2ms) SAVEPOINT active_record_1
48958
+ 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 16:31:32 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48959
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48960
+  (0.1ms) SAVEPOINT active_record_1
48961
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 492], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48962
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48963
+  (0.1ms) SAVEPOINT active_record_1
48964
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48965
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48966
+ Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 492]]
48967
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
48968
+  (0.3ms) ROLLBACK
48969
+  (0.2ms) BEGIN
48970
+ ----------------------------------------
48971
+ RoolerTest: test_delivers_pending_emails
48972
+ ----------------------------------------
48973
+  (0.2ms) SAVEPOINT active_record_1
48974
+ 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 16:31:32 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48975
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48976
+  (0.1ms) SAVEPOINT active_record_1
48977
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 493], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48978
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48979
+  (0.2ms) SAVEPOINT active_record_1
48980
+ 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 16:31:32 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48981
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48982
+  (0.1ms) SAVEPOINT active_record_1
48983
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 494], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48984
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48985
+  (0.1ms) SAVEPOINT active_record_1
48986
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 443 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 444) LIMIT 1
48987
+ 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 16:31:32 UTC +00:00], ["deliverable_id", 444], ["deliverable_type", "Rooler::Rule"], ["rule_id", 443], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
48988
+  (0.2ms) RELEASE SAVEPOINT active_record_1
48989
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
48990
+ 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", 443]]
48991
+ 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", 444]]
48992
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
48993
+
48994
+ Sent mail to test@email.com (18.2ms)
48995
+ Date: Fri, 28 Mar 2014 17:31:32 +0100
48996
+ From: default@myapp.com
48997
+ To: test@email.com
48998
+ Message-ID: <5335a3e4a2e5c_1643fe1cdc34cd854140@Yonahs-MacBook-Pro.local.mail>
48999
+ Subject: subject-16
49000
+ Mime-Version: 1.0
49001
+ Content-Type: text/html;
49002
+ charset=UTF-8
49003
+ Content-Transfer-Encoding: 7bit
49004
+
49005
+ body-16
49006
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:31:32.683865' WHERE "rooler_deliveries"."id" = 220
49007
+ Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 220]]
49008
+  (0.2ms) ROLLBACK
49009
+  (0.1ms) BEGIN
49010
+ ------------------------------------------
49011
+ RoolerTest: test_processes_scheduled_rules
49012
+ ------------------------------------------
49013
+  (0.1ms) SAVEPOINT active_record_1
49014
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49015
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49016
+  (0.1ms) SAVEPOINT active_record_1
49017
+ 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 16:31:32 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49018
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49019
+  (0.2ms) SAVEPOINT active_record_1
49020
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 495], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49021
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49022
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49023
+ 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())
49024
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 445]]
49025
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49026
+  (0.1ms) SAVEPOINT active_record_1
49027
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 445 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 297) LIMIT 1
49028
+ 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 16:31:32 UTC +00:00], ["deliverable_id", 297], ["deliverable_type", "Foo"], ["rule_id", 445], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49029
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49030
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:32.710729' WHERE "rooler_rules"."id" = 445
49031
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49032
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
49033
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 297]]
49034
+  (0.2ms) ROLLBACK
49035
+  (0.1ms) BEGIN
49036
+ --------------------------------------------
49037
+ RoolerTest: test_resets_resetable_deliveries
49038
+ --------------------------------------------
49039
+  (0.1ms) SAVEPOINT active_record_1
49040
+ 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 16:31:32 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49041
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49042
+  (0.1ms) SAVEPOINT active_record_1
49043
+ 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 16:31:32 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49044
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49045
+  (0.1ms) SAVEPOINT active_record_1
49046
+ 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 16:31:32 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 496], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49047
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49048
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 446]]
49049
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49050
+  (0.1ms) SAVEPOINT active_record_1
49051
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 446 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 298) LIMIT 1
49052
+ 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 16:31:32 UTC +00:00], ["deliverable_id", 298], ["deliverable_type", "Foo"], ["rule_id", 446], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49053
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49054
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:32.735424' WHERE "rooler_rules"."id" = 446
49055
+  (0.3ms) SAVEPOINT active_record_1
49056
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 298 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:31:32 UTC +00:00]]
49057
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49058
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49059
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
49060
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 446]]
49061
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
49062
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (298) [["rule_id", 446]]
49063
+  (0.1ms) SAVEPOINT active_record_1
49064
+ SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 222]]
49065
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49066
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49067
+  (0.1ms) ROLLBACK
49068
+  (0.1ms) BEGIN
49069
+ ----------------------------------------
49070
+ Rooler::DeliveryMailerTest: test_deliver
49071
+ ----------------------------------------
49072
+  (0.2ms) SAVEPOINT active_record_1
49073
+ SQL (9.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 16:32:12 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 16:32:12 UTC +00:00]]
49074
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49075
+  (0.2ms) SAVEPOINT active_record_1
49076
+ 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 16:32:12 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 497], ["updated_at", Fri, 28 Mar 2014 16:32:12 UTC +00:00]]
49077
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49078
+  (0.2ms) SAVEPOINT active_record_1
49079
+ Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 447 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 447) LIMIT 1
49080
+ SQL (1.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 16:32:12 UTC +00:00], ["deliverable_id", 447], ["deliverable_type", "Rooler::Rule"], ["rule_id", 447], ["updated_at", Fri, 28 Mar 2014 16:32:12 UTC +00:00]]
49081
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49082
+ Rooler::Template Load (1.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", 447]]
49083
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.4ms)
49084
+
49085
+ Sent mail to test_name@to.com (67.5ms)
49086
+ Date: Fri, 28 Mar 2014 17:32:13 +0100
49087
+ From: default@myapp.com
49088
+ To: test_name@to.com
49089
+ Cc: test_name@cc.com
49090
+ Message-ID: <5335a40d1b835_1a93fc77d034ce02239@Yonahs-MacBook-Pro.local.mail>
49091
+ Subject: subject is: test_name
49092
+ Mime-Version: 1.0
49093
+ Content-Type: text/html;
49094
+ charset=UTF-8
49095
+ Content-Transfer-Encoding: 7bit
49096
+
49097
+ body is: test_name
49098
+  (0.4ms) ROLLBACK
49099
+  (0.3ms) BEGIN
49100
+ ---------------------------------------------------------------------------------------
49101
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
49102
+ ---------------------------------------------------------------------------------------
49103
+  (0.1ms) SAVEPOINT active_record_1
49104
+ SQL (1.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49105
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49106
+  (0.2ms) SAVEPOINT active_record_1
49107
+ 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 16:32:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49108
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49109
+  (0.2ms) SAVEPOINT active_record_1
49110
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 498], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49111
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49112
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')
49113
+  (0.1ms) SAVEPOINT active_record_1
49114
+ 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 16:32:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49115
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49116
+  (0.1ms) SAVEPOINT active_record_1
49117
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 499], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49118
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49119
+  (0.2ms) ROLLBACK
49120
+  (0.1ms) BEGIN
49121
+ ------------------------------------------------------------------------------
49122
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
49123
+ ------------------------------------------------------------------------------
49124
+  (0.1ms) SAVEPOINT active_record_1
49125
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49126
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49127
+  (0.1ms) SAVEPOINT active_record_1
49128
+ 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 16:32:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49129
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49130
+  (0.2ms) SAVEPOINT active_record_1
49131
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 500], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49132
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49133
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49134
+  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]]
49135
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49136
+  (0.1ms) SAVEPOINT active_record_1
49137
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 450 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 300) LIMIT 1
49138
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 300], ["deliverable_type", "Foo"], ["rule_id", 450], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49139
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49140
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.208556' WHERE "rooler_rules"."id" = 450
49141
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49142
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49143
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]]
49144
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (300))
49145
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.212778' WHERE "rooler_rules"."id" = 450
49146
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49147
+  (0.1ms) ROLLBACK
49148
+  (0.1ms) BEGIN
49149
+ --------------------------------------------------------------------------------------------------------
49150
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
49151
+ --------------------------------------------------------------------------------------------------------
49152
+  (0.1ms) SAVEPOINT active_record_1
49153
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49154
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49155
+  (0.1ms) SAVEPOINT active_record_1
49156
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49157
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49158
+  (0.1ms) SAVEPOINT active_record_1
49159
+ 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 16:32:13 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49160
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49161
+  (0.3ms) SAVEPOINT active_record_1
49162
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 501], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49163
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49164
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
49165
+  (0.1ms) ROLLBACK
49166
+  (0.1ms) BEGIN
49167
+ --------------------------------------------------------------------------------------------------------------------------------------
49168
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
49169
+ --------------------------------------------------------------------------------------------------------------------------------------
49170
+  (0.1ms) SAVEPOINT active_record_1
49171
+ SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49173
+  (0.1ms) SAVEPOINT active_record_1
49174
+ 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 16:32:13 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49175
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49176
+  (0.1ms) SAVEPOINT active_record_1
49177
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 502], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49178
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49179
+  (0.1ms) SAVEPOINT active_record_1
49180
+ 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 16:32:13 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49181
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49182
+  (0.2ms) SAVEPOINT active_record_1
49183
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 503], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49184
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49185
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 452]]
49186
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49187
+  (0.1ms) SAVEPOINT active_record_1
49188
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 452 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 303) LIMIT 1
49189
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 303], ["deliverable_type", "Foo"], ["rule_id", 452], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49190
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49191
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.258970' WHERE "rooler_rules"."id" = 452
49192
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
49193
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]]
49194
+  (0.2ms) SAVEPOINT active_record_1
49195
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 453 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 303) LIMIT 1
49196
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 303], ["deliverable_type", "Foo"], ["rule_id", 453], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49197
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49198
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.269389' WHERE "rooler_rules"."id" = 453
49199
+  (0.1ms) SAVEPOINT active_record_1
49200
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49201
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49202
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 452]]
49203
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 452]]
49204
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (303))
49205
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 453]]
49206
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
49207
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]]
49208
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]]
49209
+  (0.3ms) ROLLBACK
49210
+  (0.3ms) BEGIN
49211
+ ----------------------------------------------------------------------------------------------------
49212
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
49213
+ ----------------------------------------------------------------------------------------------------
49214
+  (0.3ms) SAVEPOINT active_record_1
49215
+ 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 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49216
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49217
+  (0.2ms) SAVEPOINT active_record_1
49218
+ 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 16:32:13 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49219
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49220
+  (0.2ms) SAVEPOINT active_record_1
49221
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 504], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49222
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49223
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]
49224
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49225
+  (0.1ms) SAVEPOINT active_record_1
49226
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 454 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 305) LIMIT 1
49227
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 305], ["deliverable_type", "Foo"], ["rule_id", 454], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49228
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49229
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.304845' WHERE "rooler_rules"."id" = 454
49230
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]
49231
+  (0.2ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (305))
49232
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49233
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]
49234
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (305))
49235
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.311673' WHERE "rooler_rules"."id" = 454
49236
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49237
+  (0.2ms) SAVEPOINT active_record_1
49238
+ SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 305 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49239
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49240
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49241
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]
49242
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
49243
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (305) [["rule_id", 454]]
49244
+  (0.2ms) SAVEPOINT active_record_1
49245
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 227]]
49246
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49247
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49248
+  (0.1ms) SAVEPOINT active_record_1
49249
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 305 [["active", true], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49250
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49251
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49252
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]
49253
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49254
+  (0.1ms) SAVEPOINT active_record_1
49255
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 454 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 305) LIMIT 1
49256
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 305], ["deliverable_type", "Foo"], ["rule_id", 454], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49257
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49258
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.339519' WHERE "rooler_rules"."id" = 454
49259
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49260
+  (0.1ms) ROLLBACK
49261
+  (0.3ms) BEGIN
49262
+ -------------------------------------------------------------------------------------------------------------------------
49263
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
49264
+ -------------------------------------------------------------------------------------------------------------------------
49265
+  (0.2ms) SAVEPOINT active_record_1
49266
+ 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 16:32:13 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49267
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49268
+  (0.1ms) SAVEPOINT active_record_1
49269
+ SQL (0.8ms) 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:23:13 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 505], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49270
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49271
+  (0.1ms) SAVEPOINT active_record_1
49272
+ 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 16:32:13 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49273
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49274
+  (0.1ms) SAVEPOINT active_record_1
49275
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:21:13 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 506], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49276
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49277
+  (0.1ms) SAVEPOINT active_record_1
49278
+ 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 16:32:13 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49279
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49280
+  (0.2ms) SAVEPOINT active_record_1
49281
+ SQL (1.1ms) 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 507], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49282
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49283
+  (0.2ms) SAVEPOINT active_record_1
49284
+ 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-11"], ["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49285
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49286
+  (0.2ms) SAVEPOINT active_record_1
49287
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 508], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49288
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49289
+ 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())
49290
+  (0.1ms) ROLLBACK
49291
+  (0.1ms) BEGIN
49292
+ ---------------------------------------------------------------------------------------
49293
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
49294
+ ---------------------------------------------------------------------------------------
49295
+  (0.2ms) SAVEPOINT active_record_1
49296
+ 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 16:32:13 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49297
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49298
+  (0.1ms) SAVEPOINT active_record_1
49299
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
49300
+  (0.1ms) SAVEPOINT active_record_1
49301
+ 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 16:32:13 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49302
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49303
+  (0.2ms) SAVEPOINT active_record_1
49304
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
49305
+  (0.3ms) ROLLBACK
49306
+  (0.3ms) BEGIN
49307
+ --------------------------------------------------------------------------
49308
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
49309
+ --------------------------------------------------------------------------
49310
+  (0.2ms) SAVEPOINT active_record_1
49311
+ 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 16:32:13 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49312
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49313
+  (0.1ms) SAVEPOINT active_record_1
49314
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 511], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49315
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49316
+ Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 511]]
49317
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49318
+  (0.2ms) SAVEPOINT active_record_1
49319
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49320
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49321
+  (0.1ms) SAVEPOINT active_record_1
49322
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49323
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49324
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49325
+  (0.2ms) ROLLBACK
49326
+  (0.1ms) BEGIN
49327
+ ----------------------------------------------------------------------------------
49328
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
49329
+ ----------------------------------------------------------------------------------
49330
+  (0.1ms) SAVEPOINT active_record_1
49331
+ 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 16:32:13 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49332
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49333
+  (0.1ms) SAVEPOINT active_record_1
49334
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 512], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49335
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49336
+  (0.1ms) SAVEPOINT active_record_1
49337
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49338
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49339
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 512]]
49340
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49341
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49342
+  (0.3ms) ROLLBACK
49343
+  (0.2ms) BEGIN
49344
+ ----------------------------------------
49345
+ RoolerTest: test_delivers_pending_emails
49346
+ ----------------------------------------
49347
+  (0.2ms) SAVEPOINT active_record_1
49348
+ 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 16:32:13 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49349
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49350
+  (0.2ms) SAVEPOINT active_record_1
49351
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 513], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49352
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49353
+  (0.1ms) SAVEPOINT active_record_1
49354
+ 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 16:32:13 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49355
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49356
+  (0.2ms) SAVEPOINT active_record_1
49357
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 514], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49358
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49359
+  (0.2ms) SAVEPOINT active_record_1
49360
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 461 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 462) LIMIT 1
49361
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 462], ["deliverable_type", "Rooler::Rule"], ["rule_id", 461], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49362
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49363
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
49364
+ 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", 461]]
49365
+ 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", 462]]
49366
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms)
49367
+
49368
+ Sent mail to test@email.com (19.0ms)
49369
+ Date: Fri, 28 Mar 2014 17:32:13 +0100
49370
+ From: default@myapp.com
49371
+ To: test@email.com
49372
+ Message-ID: <5335a40d9877c_1a93fc77d034ce022431@Yonahs-MacBook-Pro.local.mail>
49373
+ Subject: subject-16
49374
+ Mime-Version: 1.0
49375
+ Content-Type: text/html;
49376
+ charset=UTF-8
49377
+ Content-Transfer-Encoding: 7bit
49378
+
49379
+ body-16
49380
+ SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:32:13.641816' WHERE "rooler_deliveries"."id" = 229
49381
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 229]]
49382
+  (0.2ms) ROLLBACK
49383
+  (0.1ms) BEGIN
49384
+ ------------------------------------------
49385
+ RoolerTest: test_processes_scheduled_rules
49386
+ ------------------------------------------
49387
+  (0.1ms) SAVEPOINT active_record_1
49388
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49389
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49390
+  (0.1ms) SAVEPOINT active_record_1
49391
+ 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 16:32:13 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49392
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49393
+  (0.1ms) SAVEPOINT active_record_1
49394
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 515], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49395
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49396
+  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"
49397
+ 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())
49398
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 463]]
49399
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49400
+  (0.1ms) SAVEPOINT active_record_1
49401
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 463 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 309) LIMIT 1
49402
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 309], ["deliverable_type", "Foo"], ["rule_id", 463], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49403
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49404
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.671078' WHERE "rooler_rules"."id" = 463
49405
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49406
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
49407
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 309]]
49408
+  (0.2ms) ROLLBACK
49409
+  (0.1ms) BEGIN
49410
+ --------------------------------------------
49411
+ RoolerTest: test_resets_resetable_deliveries
49412
+ --------------------------------------------
49413
+  (0.1ms) SAVEPOINT active_record_1
49414
+ 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 16:32:13 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49415
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49416
+  (0.2ms) SAVEPOINT active_record_1
49417
+ 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 16:32:13 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49418
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49419
+  (0.1ms) SAVEPOINT active_record_1
49420
+ 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 16:32:13 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 516], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49421
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49422
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]]
49423
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49424
+  (0.1ms) SAVEPOINT active_record_1
49425
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 464 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 310) LIMIT 1
49426
+ 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 16:32:13 UTC +00:00], ["deliverable_id", 310], ["deliverable_type", "Foo"], ["rule_id", 464], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49427
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49428
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.694928' WHERE "rooler_rules"."id" = 464
49429
+  (0.1ms) SAVEPOINT active_record_1
49430
+ SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 310 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:32:13 UTC +00:00]]
49431
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49432
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49433
+ Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"
49434
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]]
49435
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
49436
+ Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (310) [["rule_id", 464]]
49437
+  (0.2ms) SAVEPOINT active_record_1
49438
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 231]]
49439
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49440
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49441
+  (0.2ms) ROLLBACK
49442
+  (0.1ms) BEGIN
49443
+ ----------------------------------------
49444
+ Rooler::DeliveryMailerTest: test_deliver
49445
+ ----------------------------------------
49446
+  (0.2ms) SAVEPOINT active_record_1
49447
+ SQL (6.5ms) 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 16:34:54 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49448
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49449
+  (0.2ms) SAVEPOINT active_record_1
49450
+ SQL (2.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 16:34:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 517], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49451
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49452
+  (0.2ms) SAVEPOINT active_record_1
49453
+ Rooler::Delivery Exists (2.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 465 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 465) LIMIT 1
49454
+ SQL (1.3ms) 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 16:34:54 UTC +00:00], ["deliverable_id", 465], ["deliverable_type", "Rooler::Rule"], ["rule_id", 465], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49455
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49456
+ 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", 465]]
49457
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (5.2ms)
49458
+
49459
+ Sent mail to test_name@to.com (72.2ms)
49460
+ Date: Fri, 28 Mar 2014 17:34:54 +0100
49461
+ From: default@myapp.com
49462
+ To: test_name@to.com
49463
+ Cc: test_name@cc.com
49464
+ Message-ID: <5335a4aed3dd7_2853ff744c34cd8989f4@Yonahs-MacBook-Pro.local.mail>
49465
+ Subject: subject is: test_name
49466
+ Mime-Version: 1.0
49467
+ Content-Type: text/html;
49468
+ charset=UTF-8
49469
+ Content-Transfer-Encoding: 7bit
49470
+
49471
+ body is: test_name
49472
+  (0.3ms) ROLLBACK
49473
+  (0.2ms) BEGIN
49474
+ ---------------------------------------------------------------------------------------
49475
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
49476
+ ---------------------------------------------------------------------------------------
49477
+  (0.1ms) SAVEPOINT active_record_1
49478
+ SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49479
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49480
+  (0.2ms) SAVEPOINT active_record_1
49481
+ 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 16:34:54 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49482
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49483
+  (0.1ms) SAVEPOINT active_record_1
49484
+ 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 16:34:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 518], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49485
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49486
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
49487
+  (0.2ms) SAVEPOINT active_record_1
49488
+ 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 16:34:54 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49489
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49490
+  (0.2ms) SAVEPOINT active_record_1
49491
+ 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 16:34:54 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 519], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49492
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49493
+  (0.2ms) ROLLBACK
49494
+  (0.1ms) BEGIN
49495
+ ------------------------------------------------------------------------------
49496
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
49497
+ ------------------------------------------------------------------------------
49498
+  (0.1ms) SAVEPOINT active_record_1
49499
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49500
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49501
+  (0.2ms) SAVEPOINT active_record_1
49502
+ 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 16:34:54 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49503
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49504
+  (0.2ms) SAVEPOINT active_record_1
49505
+ 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 16:34:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 520], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49506
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49507
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49508
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]]
49509
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49510
+  (0.1ms) SAVEPOINT active_record_1
49511
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 468 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 312) LIMIT 1
49512
+ 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 16:34:54 UTC +00:00], ["deliverable_id", 312], ["deliverable_type", "Foo"], ["rule_id", 468], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49513
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49514
+ SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:54.962469' WHERE "rooler_rules"."id" = 468
49515
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49516
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49517
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]]
49518
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (312))
49519
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:54.969427' WHERE "rooler_rules"."id" = 468
49520
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49521
+  (0.2ms) ROLLBACK
49522
+  (0.2ms) BEGIN
49523
+ --------------------------------------------------------------------------------------------------------
49524
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
49525
+ --------------------------------------------------------------------------------------------------------
49526
+  (0.1ms) SAVEPOINT active_record_1
49527
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49528
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49529
+  (0.1ms) SAVEPOINT active_record_1
49530
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49531
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49532
+  (0.2ms) SAVEPOINT active_record_1
49533
+ 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-4"], ["created_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49534
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49535
+  (0.1ms) SAVEPOINT active_record_1
49536
+ 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 16:34:54 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 521], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49537
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49538
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1
49539
+  (0.2ms) ROLLBACK
49540
+  (0.1ms) BEGIN
49541
+ --------------------------------------------------------------------------------------------------------------------------------------
49542
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
49543
+ --------------------------------------------------------------------------------------------------------------------------------------
49544
+  (0.1ms) SAVEPOINT active_record_1
49545
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49546
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49547
+  (0.1ms) SAVEPOINT active_record_1
49548
+ 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 16:34:54 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49549
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49550
+  (0.1ms) SAVEPOINT active_record_1
49551
+ 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 16:34:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 522], ["updated_at", Fri, 28 Mar 2014 16:34:54 UTC +00:00]]
49552
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49553
+  (0.1ms) SAVEPOINT active_record_1
49554
+ 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 16:34:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49555
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49556
+  (0.2ms) SAVEPOINT active_record_1
49557
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 523], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49558
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49559
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 470]]
49560
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49561
+  (0.2ms) SAVEPOINT active_record_1
49562
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 470 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 315) LIMIT 1
49563
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 315], ["deliverable_type", "Foo"], ["rule_id", 470], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49564
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49565
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.017810' WHERE "rooler_rules"."id" = 470
49566
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
49567
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 471]]
49568
+  (0.2ms) SAVEPOINT active_record_1
49569
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 471 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 315) LIMIT 1
49570
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 315], ["deliverable_type", "Foo"], ["rule_id", 471], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49571
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49572
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.025751' WHERE "rooler_rules"."id" = 471
49573
+  (0.1ms) SAVEPOINT active_record_1
49574
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49575
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49576
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 470]]
49577
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 470]]
49578
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (315))
49579
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 471]]
49580
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
49581
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 471]]
49582
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 471]]
49583
+  (0.2ms) ROLLBACK
49584
+  (0.1ms) BEGIN
49585
+ ----------------------------------------------------------------------------------------------------
49586
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
49587
+ ----------------------------------------------------------------------------------------------------
49588
+  (0.1ms) SAVEPOINT active_record_1
49589
+ 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 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49590
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49591
+  (0.2ms) SAVEPOINT active_record_1
49592
+ 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 16:34:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49593
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49594
+  (0.1ms) SAVEPOINT active_record_1
49595
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 524], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49596
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49597
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]]
49598
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49599
+  (0.1ms) SAVEPOINT active_record_1
49600
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 472 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 317) LIMIT 1
49601
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 317], ["deliverable_type", "Foo"], ["rule_id", 472], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49602
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49603
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.056291' WHERE "rooler_rules"."id" = 472
49604
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]]
49605
+  (0.2ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (317))
49606
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49607
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]]
49608
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (317))
49609
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.061477' WHERE "rooler_rules"."id" = 472
49610
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49611
+  (0.1ms) SAVEPOINT active_record_1
49612
+ SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 317 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49613
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49614
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49615
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]]
49616
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
49617
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (317) [["rule_id", 472]]
49618
+  (0.2ms) SAVEPOINT active_record_1
49619
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 236]]
49620
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49621
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49622
+  (0.1ms) SAVEPOINT active_record_1
49623
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 317 [["active", true], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49624
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49625
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49626
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]]
49627
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49628
+  (0.2ms) SAVEPOINT active_record_1
49629
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 472 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 317) LIMIT 1
49630
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 317], ["deliverable_type", "Foo"], ["rule_id", 472], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49631
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49632
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.088719' WHERE "rooler_rules"."id" = 472
49633
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49634
+  (0.2ms) ROLLBACK
49635
+  (0.1ms) BEGIN
49636
+ -------------------------------------------------------------------------------------------------------------------------
49637
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
49638
+ -------------------------------------------------------------------------------------------------------------------------
49639
+  (0.2ms) SAVEPOINT active_record_1
49640
+ 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 16:34:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49641
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49642
+  (0.2ms) SAVEPOINT active_record_1
49643
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:25:55 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 525], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49644
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49645
+  (0.2ms) SAVEPOINT active_record_1
49646
+ 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 16:34:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49647
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49648
+  (0.1ms) SAVEPOINT active_record_1
49649
+ SQL (0.8ms) 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:23:55 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 526], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49650
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49651
+  (0.2ms) SAVEPOINT active_record_1
49652
+ 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 16:34:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49653
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49654
+  (0.1ms) SAVEPOINT active_record_1
49655
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 527], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49656
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49657
+  (0.1ms) SAVEPOINT active_record_1
49658
+ 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 16:34:55 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49659
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49660
+  (0.2ms) SAVEPOINT active_record_1
49661
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 528], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49662
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49663
+ 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())
49664
+  (0.2ms) ROLLBACK
49665
+  (0.2ms) BEGIN
49666
+ ---------------------------------------------------------------------------------------
49667
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
49668
+ ---------------------------------------------------------------------------------------
49669
+  (0.2ms) SAVEPOINT active_record_1
49670
+ 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 16:34:55 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49671
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49672
+  (0.1ms) SAVEPOINT active_record_1
49673
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
49674
+  (0.2ms) SAVEPOINT active_record_1
49675
+ 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 16:34:55 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49676
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49677
+  (0.1ms) SAVEPOINT active_record_1
49678
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
49679
+  (0.2ms) ROLLBACK
49680
+  (0.2ms) BEGIN
49681
+ --------------------------------------------------------------------------
49682
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
49683
+ --------------------------------------------------------------------------
49684
+  (0.2ms) SAVEPOINT active_record_1
49685
+ 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 16:34:55 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49686
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49687
+  (0.1ms) SAVEPOINT active_record_1
49688
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 531], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49689
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49690
+ Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 531]]
49691
+ Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49692
+  (0.2ms) SAVEPOINT active_record_1
49693
+ SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49694
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49695
+  (0.1ms) SAVEPOINT active_record_1
49696
+ SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49697
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49698
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49699
+  (0.2ms) ROLLBACK
49700
+  (0.2ms) BEGIN
49701
+ ----------------------------------------------------------------------------------
49702
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
49703
+ ----------------------------------------------------------------------------------
49704
+  (0.2ms) SAVEPOINT active_record_1
49705
+ 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 16:34:55 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49706
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49707
+  (0.2ms) SAVEPOINT active_record_1
49708
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 532], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49709
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49710
+  (0.1ms) SAVEPOINT active_record_1
49711
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49712
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49713
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 532]]
49714
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49715
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
49716
+  (0.3ms) ROLLBACK
49717
+  (0.2ms) BEGIN
49718
+ ----------------------------------------
49719
+ RoolerTest: test_delivers_pending_emails
49720
+ ----------------------------------------
49721
+  (0.2ms) SAVEPOINT active_record_1
49722
+ 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 16:34:55 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49723
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49724
+  (0.2ms) SAVEPOINT active_record_1
49725
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 533], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49726
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49727
+  (0.2ms) SAVEPOINT active_record_1
49728
+ 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 16:34:55 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49729
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49730
+  (0.1ms) SAVEPOINT active_record_1
49731
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 534], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49732
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49733
+  (0.1ms) SAVEPOINT active_record_1
49734
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 479 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 480) LIMIT 1
49735
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 480], ["deliverable_type", "Rooler::Rule"], ["rule_id", 479], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49736
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49737
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
49738
+ 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", 479]]
49739
+ 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", 480]]
49740
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
49741
+
49742
+ Sent mail to test@email.com (15.8ms)
49743
+ Date: Fri, 28 Mar 2014 17:34:55 +0100
49744
+ From: default@myapp.com
49745
+ To: test@email.com
49746
+ Message-ID: <5335a4af58b30_2853ff744c34cd8990be@Yonahs-MacBook-Pro.local.mail>
49747
+ Subject: subject-16
49748
+ Mime-Version: 1.0
49749
+ Content-Type: text/html;
49750
+ charset=UTF-8
49751
+ Content-Transfer-Encoding: 7bit
49752
+
49753
+ body-16
49754
+ SQL (0.3ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:34:55.377513' WHERE "rooler_deliveries"."id" = 238
49755
+ Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 238]]
49756
+  (0.2ms) ROLLBACK
49757
+  (0.2ms) BEGIN
49758
+ ------------------------------------------
49759
+ RoolerTest: test_processes_scheduled_rules
49760
+ ------------------------------------------
49761
+  (0.1ms) SAVEPOINT active_record_1
49762
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49763
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49764
+  (0.1ms) SAVEPOINT active_record_1
49765
+ 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 16:34:55 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49766
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49767
+  (0.2ms) SAVEPOINT active_record_1
49768
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 535], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49769
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49770
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49771
+ 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())
49772
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 481]]
49773
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49774
+  (0.1ms) SAVEPOINT active_record_1
49775
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 481 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 321) LIMIT 1
49776
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 321], ["deliverable_type", "Foo"], ["rule_id", 481], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49777
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49778
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.407595' WHERE "rooler_rules"."id" = 481
49779
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49780
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
49781
+ Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 321]]
49782
+  (0.2ms) ROLLBACK
49783
+  (0.2ms) BEGIN
49784
+ --------------------------------------------
49785
+ RoolerTest: test_resets_resetable_deliveries
49786
+ --------------------------------------------
49787
+  (0.2ms) SAVEPOINT active_record_1
49788
+ 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 16:34:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49789
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49790
+  (0.1ms) SAVEPOINT active_record_1
49791
+ 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 16:34:55 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49792
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49793
+  (0.2ms) SAVEPOINT active_record_1
49794
+ 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 16:34:55 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 536], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49795
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49796
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 482]]
49797
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49798
+  (0.2ms) SAVEPOINT active_record_1
49799
+ Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 482 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1
49800
+ 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 16:34:55 UTC +00:00], ["deliverable_id", 322], ["deliverable_type", "Foo"], ["rule_id", 482], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49801
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49802
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.437783' WHERE "rooler_rules"."id" = 482
49803
+  (0.1ms) SAVEPOINT active_record_1
49804
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 322 [["active", false], ["updated_at", Fri, 28 Mar 2014 16:34:55 UTC +00:00]]
49805
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49806
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49807
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
49808
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 482]]
49809
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
49810
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (322) [["rule_id", 482]]
49811
+  (0.1ms) SAVEPOINT active_record_1
49812
+ SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 240]]
49813
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49814
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49815
+  (0.2ms) ROLLBACK
49816
+  (0.1ms) BEGIN
49817
+ ----------------------------------------
49818
+ Rooler::DeliveryMailerTest: test_deliver
49819
+ ----------------------------------------
49820
+  (0.2ms) SAVEPOINT active_record_1
49821
+ SQL (8.5ms) 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 17:00:15 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49822
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49823
+  (0.2ms) SAVEPOINT active_record_1
49824
+ 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 17:00:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 537], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49825
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49826
+  (0.3ms) SAVEPOINT active_record_1
49827
+ Rooler::Delivery Exists (2.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 483 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 483) LIMIT 1
49828
+ SQL (1.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 17:00:15 UTC +00:00], ["deliverable_id", 483], ["deliverable_type", "Rooler::Rule"], ["rule_id", 483], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49829
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49830
+ 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", 483]]
49831
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.5ms)
49832
+
49833
+ Sent mail to test_name@to.com (74.4ms)
49834
+ Date: Fri, 28 Mar 2014 18:00:15 +0100
49835
+ From: default@myapp.com
49836
+ To: test_name@to.com
49837
+ Cc: test_name@cc.com
49838
+ Message-ID: <5335aa9fe3d19_9af3fd3b1c34cd0906f1@Yonahs-MacBook-Pro.local.mail>
49839
+ Subject: subject is: test_name
49840
+ Mime-Version: 1.0
49841
+ Content-Type: text/html;
49842
+ charset=UTF-8
49843
+ Content-Transfer-Encoding: 7bit
49844
+
49845
+ body is: test_name
49846
+  (0.4ms) ROLLBACK
49847
+  (0.2ms) BEGIN
49848
+ ---------------------------------------------------------------------------------------
49849
+ Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method
49850
+ ---------------------------------------------------------------------------------------
49851
+  (0.2ms) SAVEPOINT active_record_1
49852
+ SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49853
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49854
+  (0.2ms) SAVEPOINT active_record_1
49855
+ 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-1"], ["created_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49856
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49857
+  (0.1ms) SAVEPOINT active_record_1
49858
+ 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 17:00:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 538], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49859
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49860
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')
49861
+  (0.2ms) SAVEPOINT active_record_1
49862
+ 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 17:00:15 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49863
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49864
+  (0.1ms) SAVEPOINT active_record_1
49865
+ 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 17:00:15 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 539], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49866
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49867
+  (0.2ms) ROLLBACK
49868
+  (0.1ms) BEGIN
49869
+ ------------------------------------------------------------------------------
49870
+ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule
49871
+ ------------------------------------------------------------------------------
49872
+  (0.1ms) SAVEPOINT active_record_1
49873
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49874
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49875
+  (0.1ms) SAVEPOINT active_record_1
49876
+ 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 17:00:15 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49877
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49878
+  (0.2ms) SAVEPOINT active_record_1
49879
+ 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 17:00:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 540], ["updated_at", Fri, 28 Mar 2014 17:00:15 UTC +00:00]]
49880
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49881
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
49882
+  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 486]]
49883
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49884
+  (0.2ms) SAVEPOINT active_record_1
49885
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 486 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 324) LIMIT 1
49886
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 324], ["deliverable_type", "Foo"], ["rule_id", 486], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49887
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49888
+ SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.045744' WHERE "rooler_rules"."id" = 486
49889
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49890
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49891
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 486]]
49892
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (324))
49893
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.050864' WHERE "rooler_rules"."id" = 486
49894
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49895
+  (0.1ms) ROLLBACK
49896
+  (0.1ms) BEGIN
49897
+ --------------------------------------------------------------------------------------------------------
49898
+ Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params.
49899
+ --------------------------------------------------------------------------------------------------------
49900
+  (0.1ms) SAVEPOINT active_record_1
49901
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49902
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49903
+  (0.1ms) SAVEPOINT active_record_1
49904
+ SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49905
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49906
+  (0.2ms) SAVEPOINT active_record_1
49907
+ 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 17:00:16 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49908
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49909
+  (0.1ms) SAVEPOINT active_record_1
49910
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 541], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49911
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49912
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1
49913
+  (0.2ms) ROLLBACK
49914
+  (0.1ms) BEGIN
49915
+ --------------------------------------------------------------------------------------------------------------------------------------
49916
+ Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays
49917
+ --------------------------------------------------------------------------------------------------------------------------------------
49918
+  (0.1ms) SAVEPOINT active_record_1
49919
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49920
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49921
+  (0.2ms) SAVEPOINT active_record_1
49922
+ 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 17:00:16 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49923
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49924
+  (0.1ms) SAVEPOINT active_record_1
49925
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 542], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49926
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49927
+  (0.1ms) SAVEPOINT active_record_1
49928
+ 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 17:00:16 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49929
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49930
+  (0.1ms) SAVEPOINT active_record_1
49931
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 543], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49932
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49933
+  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 488]]
49934
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
49935
+  (0.1ms) SAVEPOINT active_record_1
49936
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 488 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 327) LIMIT 1
49937
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 327], ["deliverable_type", "Foo"], ["rule_id", 488], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49938
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49939
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.093730' WHERE "rooler_rules"."id" = 488
49940
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')
49941
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]]
49942
+  (0.2ms) SAVEPOINT active_record_1
49943
+ Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 489 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 327) LIMIT 1
49944
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 327], ["deliverable_type", "Foo"], ["rule_id", 489], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49945
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49946
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.104519' WHERE "rooler_rules"."id" = 489
49947
+  (0.1ms) SAVEPOINT active_record_1
49948
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49949
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49950
+ Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 488]]
49951
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 488]]
49952
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (327))
49953
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 489]]
49954
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')
49955
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]]
49956
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]]
49957
+  (0.1ms) ROLLBACK
49958
+  (0.1ms) BEGIN
49959
+ ----------------------------------------------------------------------------------------------------
49960
+ Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them
49961
+ ----------------------------------------------------------------------------------------------------
49962
+  (0.1ms) SAVEPOINT active_record_1
49963
+ 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 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49964
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49965
+  (0.1ms) SAVEPOINT active_record_1
49966
+ 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 17:00:16 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49967
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49968
+  (0.2ms) SAVEPOINT active_record_1
49969
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 544], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49970
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49971
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]]
49972
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
49973
+  (0.1ms) SAVEPOINT active_record_1
49974
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 490 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 329) LIMIT 1
49975
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 329], ["deliverable_type", "Foo"], ["rule_id", 490], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49976
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49977
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.139270' WHERE "rooler_rules"."id" = 490
49978
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]]
49979
+  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (329))
49980
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49981
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]]
49982
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (329))
49983
+ SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.144661' WHERE "rooler_rules"."id" = 490
49984
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
49985
+  (0.3ms) SAVEPOINT active_record_1
49986
+ SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 329 [["active", false], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49987
+  (0.3ms) RELEASE SAVEPOINT active_record_1
49988
+  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"
49989
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]]
49990
+ Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
49991
+ Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (329) [["rule_id", 490]]
49992
+  (0.2ms) SAVEPOINT active_record_1
49993
+ SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 245]]
49994
+  (0.2ms) RELEASE SAVEPOINT active_record_1
49995
+  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"
49996
+  (0.1ms) SAVEPOINT active_record_1
49997
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 329 [["active", true], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
49998
+  (0.1ms) RELEASE SAVEPOINT active_record_1
49999
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
50000
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]]
50001
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
50002
+  (0.1ms) SAVEPOINT active_record_1
50003
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 490 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 329) LIMIT 1
50004
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 329], ["deliverable_type", "Foo"], ["rule_id", 490], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50005
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50006
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.172882' WHERE "rooler_rules"."id" = 490
50007
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
50008
+  (0.1ms) ROLLBACK
50009
+  (0.1ms) BEGIN
50010
+ -------------------------------------------------------------------------------------------------------------------------
50011
+ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil
50012
+ -------------------------------------------------------------------------------------------------------------------------
50013
+  (0.2ms) SAVEPOINT active_record_1
50014
+ 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 17:00:16 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50015
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50016
+  (0.2ms) SAVEPOINT active_record_1
50017
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:51:16 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 545], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50018
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50019
+  (0.2ms) SAVEPOINT active_record_1
50020
+ 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 17:00:16 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50021
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50022
+  (0.2ms) SAVEPOINT active_record_1
50023
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 16:49:16 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 546], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50024
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50025
+  (0.2ms) SAVEPOINT active_record_1
50026
+ 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 17:00:16 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50027
+  (0.2ms) RELEASE SAVEPOINT active_record_1
50028
+  (0.1ms) SAVEPOINT active_record_1
50029
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 547], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50030
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50031
+  (0.1ms) SAVEPOINT active_record_1
50032
+ 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 17:00:16 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50033
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50034
+  (0.2ms) SAVEPOINT active_record_1
50035
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 548], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50036
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50037
+ 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())
50038
+  (0.1ms) ROLLBACK
50039
+  (0.2ms) BEGIN
50040
+ ---------------------------------------------------------------------------------------
50041
+ Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name
50042
+ ---------------------------------------------------------------------------------------
50043
+  (0.1ms) SAVEPOINT active_record_1
50044
+ 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 17:00:16 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50045
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50046
+  (0.1ms) SAVEPOINT active_record_1
50047
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
50048
+  (0.1ms) SAVEPOINT active_record_1
50049
+ 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 17:00:16 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50050
+  (0.3ms) RELEASE SAVEPOINT active_record_1
50051
+  (0.1ms) SAVEPOINT active_record_1
50052
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
50053
+  (0.2ms) ROLLBACK
50054
+  (0.1ms) BEGIN
50055
+ --------------------------------------------------------------------------
50056
+ Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules
50057
+ --------------------------------------------------------------------------
50058
+  (0.1ms) SAVEPOINT active_record_1
50059
+ 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 17:00:16 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50060
+  (0.2ms) RELEASE SAVEPOINT active_record_1
50061
+  (0.1ms) SAVEPOINT active_record_1
50062
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 551], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50063
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50064
+ Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 551]]
50065
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
50066
+  (0.2ms) SAVEPOINT active_record_1
50067
+ SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50068
+  (0.2ms) RELEASE SAVEPOINT active_record_1
50069
+  (0.2ms) SAVEPOINT active_record_1
50070
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50071
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50072
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
50073
+  (0.2ms) ROLLBACK
50074
+  (0.1ms) BEGIN
50075
+ ----------------------------------------------------------------------------------
50076
+ Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object
50077
+ ----------------------------------------------------------------------------------
50078
+  (0.1ms) SAVEPOINT active_record_1
50079
+ 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 17:00:16 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50080
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50081
+  (0.1ms) SAVEPOINT active_record_1
50082
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 552], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50083
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50084
+  (0.1ms) SAVEPOINT active_record_1
50085
+ SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50086
+  (0.4ms) RELEASE SAVEPOINT active_record_1
50087
+ Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 552]]
50088
+ Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1
50089
+  (0.3ms) ROLLBACK
50090
+  (0.2ms) BEGIN
50091
+ ----------------------------------------
50092
+ RoolerTest: test_delivers_pending_emails
50093
+ ----------------------------------------
50094
+  (0.2ms) SAVEPOINT active_record_1
50095
+ 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 17:00:16 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50096
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50097
+  (0.1ms) SAVEPOINT active_record_1
50098
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 553], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50099
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50100
+  (0.1ms) SAVEPOINT active_record_1
50101
+ 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 17:00:16 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50102
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50103
+  (0.1ms) SAVEPOINT active_record_1
50104
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 554], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50105
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50106
+  (0.1ms) SAVEPOINT active_record_1
50107
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 497 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 498) LIMIT 1
50108
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 498], ["deliverable_type", "Rooler::Rule"], ["rule_id", 497], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50109
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50110
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL
50111
+ 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", 497]]
50112
+ Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 498]]
50113
+ Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms)
50114
+
50115
+ Sent mail to test@email.com (14.1ms)
50116
+ Date: Fri, 28 Mar 2014 18:00:16 +0100
50117
+ From: default@myapp.com
50118
+ To: test@email.com
50119
+ Message-ID: <5335aaa075104_9af3fd3b1c34cd090794@Yonahs-MacBook-Pro.local.mail>
50120
+ Subject: subject-16
50121
+ Mime-Version: 1.0
50122
+ Content-Type: text/html;
50123
+ charset=UTF-8
50124
+ Content-Transfer-Encoding: 7bit
50125
+
50126
+ body-16
50127
+ SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 17:00:16.492084' WHERE "rooler_deliveries"."id" = 247
50128
+ Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 247]]
50129
+  (0.3ms) ROLLBACK
50130
+  (0.1ms) BEGIN
50131
+ ------------------------------------------
50132
+ RoolerTest: test_processes_scheduled_rules
50133
+ ------------------------------------------
50134
+  (0.1ms) SAVEPOINT active_record_1
50135
+ SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50136
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50137
+  (0.1ms) SAVEPOINT active_record_1
50138
+ 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 17:00:16 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50139
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50140
+  (0.2ms) SAVEPOINT active_record_1
50141
+ 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", 60], ["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 555], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50142
+  (0.2ms) RELEASE SAVEPOINT active_record_1
50143
+  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"
50144
+ 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())
50145
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 499]]
50146
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)
50147
+  (0.1ms) SAVEPOINT active_record_1
50148
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 499 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 333) LIMIT 1
50149
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 333], ["deliverable_type", "Foo"], ["rule_id", 499], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50150
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50151
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.522610' WHERE "rooler_rules"."id" = 499
50152
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
50153
+ Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1
50154
+ Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 333]]
50155
+  (0.1ms) ROLLBACK
50156
+  (0.1ms) BEGIN
50157
+ --------------------------------------------
50158
+ RoolerTest: test_resets_resetable_deliveries
50159
+ --------------------------------------------
50160
+  (0.1ms) SAVEPOINT active_record_1
50161
+ SQL (0.4ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50162
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50163
+  (0.1ms) SAVEPOINT active_record_1
50164
+ 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 17:00:16 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50166
+  (0.1ms) SAVEPOINT active_record_1
50167
+ 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 17:00:16 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 556], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50168
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50169
+  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]]
50170
+ Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)
50171
+  (0.1ms) SAVEPOINT active_record_1
50172
+ Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 500 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 334) LIMIT 1
50173
+ 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 17:00:16 UTC +00:00], ["deliverable_id", 334], ["deliverable_type", "Foo"], ["rule_id", 500], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50174
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50175
+ SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.545752' WHERE "rooler_rules"."id" = 500
50176
+  (0.1ms) SAVEPOINT active_record_1
50177
+ SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 334 [["active", false], ["updated_at", Fri, 28 Mar 2014 17:00:16 UTC +00:00]]
50178
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50179
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
50180
+ Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"
50181
+  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]]
50182
+ Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'
50183
+ Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (334) [["rule_id", 500]]
50184
+  (0.1ms) SAVEPOINT active_record_1
50185
+ SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 249]]
50186
+  (0.1ms) RELEASE SAVEPOINT active_record_1
50187
+  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"
50188
+  (0.1ms) ROLLBACK