(0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ---------------------------------------------------------------------------------------------------------------------------------------- PG::UndefinedTable: ERROR: relation "rooler_rules" does not exist LINE 5: WHERE a.attrelid = '"rooler_rules"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"rooler_rules"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- PG::UndefinedTable: ERROR: relation "rooler_rules" does not exist LINE 5: WHERE a.attrelid = '"rooler_rules"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"rooler_rules"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------ PG::UndefinedTable: ERROR: relation "rooler_rules" does not exist LINE 5: WHERE a.attrelid = '"rooler_rules"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"rooler_rules"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 1], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 2], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-3"], ["template_id", 3], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 11:47:40 UTC +00:00], ["name", "rule-4"], ["template_id", 4], ["updated_at", Wed, 26 Feb 2014 11:58:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (11.6ms) 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", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 5], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 6], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 7], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-4"], ["template_id", 8], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 11:48:30 UTC +00:00], ["name", "rule-5"], ["template_id", 9], ["updated_at", Wed, 26 Feb 2014 11:59:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.5ms) 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", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 10], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 11], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 12], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_rules" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" PG::UndefinedTable: ERROR: relation "rooler_deliveries" does not exist LINE 5: WHERE a.attrelid = '"rooler_deliveries"'::reg... ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"rooler_deliveries"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-4"], ["template_id", 13], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:14:35 UTC +00:00], ["name", "rule-5"], ["template_id", 14], ["updated_at", Wed, 26 Feb 2014 12:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.1ms) 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", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 1], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 2], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 3], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_rules" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-4"], ["template_id", 4], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:15:13 UTC +00:00], ["name", "rule-5"], ["template_id", 5], ["updated_at", Wed, 26 Feb 2014 12:26:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.3ms) 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", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 6], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 7], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 8], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 9], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_rules" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["deliverable_id", 9], ["deliverable_type", "Rooler::Rule"], ["rule_id", 9], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_rules"  (0.6ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 10], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:16:48 UTC +00:00], ["name", "rule-6"], ["template_id", 11], ["updated_at", Wed, 26 Feb 2014 12:27:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 12], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 13], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 14], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 15], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SAVEPOINT active_record_1 SQL (1.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", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["deliverable_id", 15], ["deliverable_type", "Rooler::Rule"], ["rule_id", 15], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 16], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:17:09 UTC +00:00], ["name", "rule-6"], ["template_id", 17], ["updated_at", Wed, 26 Feb 2014 12:28:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.5ms) 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", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 18], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 19], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 20], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 21], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SAVEPOINT active_record_1 SQL (1.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", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["deliverable_id", 21], ["deliverable_type", "Rooler::Rule"], ["rule_id", 21], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 22], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:17:52 UTC +00:00], ["name", "rule-6"], ["template_id", 23], ["updated_at", Wed, 26 Feb 2014 12:28:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.5ms) 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", Wed, 26 Feb 2014 12:29:12 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 24], ["updated_at", Wed, 26 Feb 2014 12:29:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 25], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 26], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 27], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["deliverable_id", 27], ["deliverable_type", "Rooler::Rule"], ["rule_id", 27], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["deliverable_id", 27], ["deliverable_type", "Rooler::Rule"], ["rule_id", 27], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 28], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:18:13 UTC +00:00], ["name", "rule-6"], ["template_id", 29], ["updated_at", Wed, 26 Feb 2014 12:29:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 30], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 31], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 32], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 33], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 34], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:18:34 UTC +00:00], ["name", "rule-6"], ["template_id", 35], ["updated_at", Wed, 26 Feb 2014 12:29:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 36], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 37], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 38], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 39], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 39 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 39) LIMIT 1 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", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["deliverable_id", 39], ["deliverable_type", "Rooler::Rule"], ["rule_id", 39], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 39 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 39) LIMIT 1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 40], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:20:48 UTC +00:00], ["name", "rule-6"], ["template_id", 41], ["updated_at", Wed, 26 Feb 2014 12:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.5ms) 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", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 42], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 43], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 44], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 45], ["updated_at", Wed, 26 Feb 2014 12:33:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 45 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 45) LIMIT 1 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", Wed, 26 Feb 2014 12:33:20 UTC +00:00], ["deliverable_id", 45], ["deliverable_type", "Rooler::Rule"], ["rule_id", 45], ["updated_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 45 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 45) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:33:20 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 46], ["updated_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:22:20 UTC +00:00], ["name", "rule-6"], ["template_id", 47], ["updated_at", Wed, 26 Feb 2014 12:33:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 48], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 49], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 50], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 51], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 51 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 51) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["deliverable_id", 51], ["deliverable_type", "Rooler::Rule"], ["rule_id", 51], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 51 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 51) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 52], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:22:48 UTC +00:00], ["name", "rule-6"], ["template_id", 53], ["updated_at", Wed, 26 Feb 2014 12:33:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 54], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 55], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 56], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 57], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 57 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 57) LIMIT 1 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", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["deliverable_id", 57], ["deliverable_type", "Rooler::Rule"], ["rule_id", 57], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 57 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 57) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 58], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:23:01 UTC +00:00], ["name", "rule-6"], ["template_id", 59], ["updated_at", Wed, 26 Feb 2014 12:34:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.3ms) 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", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 60], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 61], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 62], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 63], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 63 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 63) LIMIT 1 SQL (2.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["deliverable_id", 63], ["deliverable_type", "Rooler::Rule"], ["rule_id", 63], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 63 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 63) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 64], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:23:28 UTC +00:00], ["name", "rule-6"], ["template_id", 65], ["updated_at", Wed, 26 Feb 2014 12:34:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.4ms) 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", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 66], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 67], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 68], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 69], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-5"], ["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 70], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:24:32 UTC +00:00], ["name", "rule-6"], ["template_id", 71], ["updated_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.6ms) 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", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 72], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 73], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 74], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_for_objects_matching_rule -------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 75], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 75 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 75) LIMIT 1 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", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["deliverable_id", 75], ["deliverable_type", "Rooler::Rule"], ["rule_id", 75], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 75 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 75) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-5"], ["template_id", 76], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:24:56 UTC +00:00], ["name", "rule-6"], ["template_id", 77], ["updated_at", Wed, 26 Feb 2014 12:35:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) 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", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 78], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 79], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 80], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_rule ------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 81], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 81 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 81) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["deliverable_id", 81], ["deliverable_type", "Rooler::Rule"], ["rule_id", 81], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 81 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 81) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 82], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 82 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 81) LIMIT 1 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", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["deliverable_id", 81], ["deliverable_type", "Rooler::Rule"], ["rule_id", 82], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 82 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 82) LIMIT 1 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", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["deliverable_id", 82], ["deliverable_type", "Rooler::Rule"], ["rule_id", 82], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-6"], ["template_id", 83], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:27:03 UTC +00:00], ["name", "rule-7"], ["template_id", 84], ["updated_at", Wed, 26 Feb 2014 12:38:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 85], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 86], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 87], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 88], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 88 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 88) LIMIT 1 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", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["deliverable_id", 88], ["deliverable_type", "Rooler::Rule"], ["rule_id", 88], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 88 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 88) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 89], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 89 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1 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", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["deliverable_id", 89], ["deliverable_type", "Rooler::Rule"], ["rule_id", 89], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 89 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-6"], ["template_id", 90], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:34:19 UTC +00:00], ["name", "rule-7"], ["template_id", 91], ["updated_at", Wed, 26 Feb 2014 12:45:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 92], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 93], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 94], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 95], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 95 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 95) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["deliverable_id", 95], ["deliverable_type", "Rooler::Rule"], ["rule_id", 95], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 95 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 95) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 96], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 96) LIMIT 1 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", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["deliverable_id", 96], ["deliverable_type", "Rooler::Rule"], ["rule_id", 96], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 96) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 97], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-7"], ["template_id", 98], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:35:32 UTC +00:00], ["name", "rule-8"], ["template_id", 99], ["updated_at", Wed, 26 Feb 2014 12:46:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.5ms) 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 100], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 101], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 102], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 101 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 101) LIMIT 1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["deliverable_id", 101], ["deliverable_type", "Rooler::Rule"], ["rule_id", 101], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 101 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 102) LIMIT 1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["deliverable_id", 102], ["deliverable_type", "Rooler::Rule"], ["rule_id", 101], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 102 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 102) LIMIT 1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["deliverable_id", 102], ["deliverable_type", "Rooler::Rule"], ["rule_id", 102], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 103], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 103 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["deliverable_id", 103], ["deliverable_type", "Rooler::Rule"], ["rule_id", 103], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 103 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 104], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 104 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 104) LIMIT 1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["deliverable_id", 104], ["deliverable_type", "Rooler::Rule"], ["rule_id", 104], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 104 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 104) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 105], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["name", "rule-7"], ["template_id", 106], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rule"], ["last_checked_at", Wed, 26 Feb 2014 12:38:08 UTC +00:00], ["name", "rule-8"], ["template_id", 107], ["updated_at", Wed, 26 Feb 2014 12:49:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 108], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 109], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (1.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 110], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (14.6ms) SELECT DISTINCT "rooler_rules"."id" FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) ORDER BY "rooler_rules"."id" DESC LIMIT 1 SQL (1.2ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) AND "rooler_rules"."id" IN (110) ORDER BY "rooler_rules"."id" DESC SQL (1.3ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 109 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 109) LIMIT 1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["deliverable_id", 109], ["deliverable_type", "Rooler::Rule"], ["rule_id", 109], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 109 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 110) LIMIT 1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["deliverable_id", 110], ["deliverable_type", "Rooler::Rule"], ["rule_id", 109], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) SELECT DISTINCT "rooler_rules"."id" FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) ORDER BY "rooler_rules"."id" DESC LIMIT 1 SQL (0.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) AND "rooler_rules"."id" IN (110) ORDER BY "rooler_rules"."id" DESC  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 110 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 110) LIMIT 1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["deliverable_id", 110], ["deliverable_type", "Rooler::Rule"], ["rule_id", 110], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 111], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" SQL (0.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 111 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 111) LIMIT 1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["deliverable_id", 111], ["deliverable_type", "Rooler::Rule"], ["rule_id", 111], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 112], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 112 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 112) LIMIT 1 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", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["deliverable_id", 112], ["deliverable_type", "Rooler::Rule"], ["rule_id", 112], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 112 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 112) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 113], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 114], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 13:58:09 UTC +00:00], ["name", "rule-8"], ["template_id", 115], ["updated_at", Wed, 26 Feb 2014 14:09:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 14:10:52 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 116], ["updated_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 117], ["updated_at", Wed, 26 Feb 2014 14:10:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (2.1ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 118], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (1.4ms) SELECT DISTINCT "rooler_rules"."id" FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) ORDER BY "rooler_rules"."id" DESC LIMIT 1 SQL (0.9ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) AND "rooler_rules"."id" IN (118) ORDER BY "rooler_rules"."id" DESC SQL (0.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 117 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 117) LIMIT 1 SQL (1.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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["deliverable_id", 117], ["deliverable_type", "Rooler::Rule"], ["rule_id", 117], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 117 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 118) LIMIT 1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["deliverable_id", 118], ["deliverable_type", "Rooler::Rule"], ["rule_id", 117], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) SELECT DISTINCT "rooler_rules"."id" FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) ORDER BY "rooler_rules"."id" DESC LIMIT 1 SQL (1.0ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) AND "rooler_rules"."id" IN (118) ORDER BY "rooler_rules"."id" DESC  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 118 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 118) LIMIT 1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["deliverable_id", 118], ["deliverable_type", "Rooler::Rule"], ["rule_id", 118], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 119], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" SQL (0.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 119 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 119) LIMIT 1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["deliverable_id", 119], ["deliverable_type", "Rooler::Rule"], ["rule_id", 119], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 120], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 120 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 120) LIMIT 1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["deliverable_id", 120], ["deliverable_type", "Rooler::Rule"], ["rule_id", 120], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 120 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 120) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 121], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 122], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 13:59:53 UTC +00:00], ["name", "rule-8"], ["template_id", 123], ["updated_at", Wed, 26 Feb 2014 14:10:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.6ms) 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 124], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 125], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (1.8ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.5ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 126], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (1.1ms) SELECT DISTINCT "rooler_rules"."id" FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) ORDER BY "rooler_rules"."id" DESC LIMIT 1 SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) AND "rooler_rules"."id" IN (126) ORDER BY "rooler_rules"."id" DESC SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 125 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 125) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["deliverable_id", 125], ["deliverable_type", "Rooler::Rule"], ["rule_id", 125], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 125 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 126) LIMIT 1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["deliverable_id", 126], ["deliverable_type", "Rooler::Rule"], ["rule_id", 125], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) SELECT DISTINCT "rooler_rules"."id" FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) ORDER BY "rooler_rules"."id" DESC LIMIT 1 SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL) AND "rooler_rules"."id" IN (126) ORDER BY "rooler_rules"."id" DESC  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 126 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 126) LIMIT 1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["deliverable_id", 126], ["deliverable_type", "Rooler::Rule"], ["rule_id", 126], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 127], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 127 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Rooler::Rule"], ["rule_id", 127], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" SQL (0.7ms) SELECT "rooler_rules"."id" AS t0_r0, "rooler_rules"."name" AS t0_r1, "rooler_rules"."template_id" AS t0_r2, "rooler_rules"."check_frequency" AS t0_r3, "rooler_rules"."last_checked_at" AS t0_r4, "rooler_rules"."klass_name" AS t0_r5, "rooler_rules"."klass_finder_method" AS t0_r6, "rooler_rules"."instance_checker_method" AS t0_r7, "rooler_rules"."created_at" AS t0_r8, "rooler_rules"."updated_at" AS t0_r9, "rooler_deliveries"."id" AS t1_r0, "rooler_deliveries"."deliverable_type" AS t1_r1, "rooler_deliveries"."deliverable_id" AS t1_r2, "rooler_deliveries"."rule_id" AS t1_r3, "rooler_deliveries"."delivered_at" AS t1_r4, "rooler_deliveries"."created_at" AS t1_r5, "rooler_deliveries"."updated_at" AS t1_r6 FROM "rooler_rules" LEFT OUTER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.id IS NULL)  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 128], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 128 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 128) LIMIT 1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["deliverable_id", 128], ["deliverable_type", "Rooler::Rule"], ["rule_id", 128], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 128 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 128) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 129], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 130], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:02:29 UTC +00:00], ["name", "rule-8"], ["template_id", 131], ["updated_at", Wed, 26 Feb 2014 14:13:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.4ms) 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", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 132], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 133], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE "rooler_rules"."rule_id" = 133))) PG::UndefinedColumn: ERROR: column rooler_rules.rule_id does not exist LINE 1: ...deliveries"."rule_id" = "rooler_rules"."id" WHERE "rooler_ru... ^ : SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE "rooler_rules"."rule_id" = 133)))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 134], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE "rooler_rules"."rule_id" = 134))) PG::UndefinedColumn: ERROR: column rooler_rules.rule_id does not exist LINE 1: ...deliveries"."rule_id" = "rooler_rules"."id" WHERE "rooler_ru... ^ : SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE "rooler_rules"."rule_id" = 134)))  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 135], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 135 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 135) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00], ["deliverable_id", 135], ["deliverable_type", "Rooler::Rule"], ["rule_id", 135], ["updated_at", Wed, 26 Feb 2014 14:52:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 135 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 135) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-5"], ["created_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 136], ["updated_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Wed, 26 Feb 2014 14:52:31 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 137], ["updated_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Wed, 26 Feb 2014 14:52:31 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:41:31 UTC +00:00], ["name", "rule-7"], ["template_id", 138], ["updated_at", Wed, 26 Feb 2014 14:52:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.6ms) ROLLBACK  (0.7ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 139], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 140], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 140))))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 141], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 141)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 140))))  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 140 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 140) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["deliverable_id", 140], ["deliverable_type", "Rooler::Rule"], ["rule_id", 140], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 140 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 141) LIMIT 1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["deliverable_id", 141], ["deliverable_type", "Rooler::Rule"], ["rule_id", 140], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 141)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 141 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 141) LIMIT 1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["deliverable_id", 141], ["deliverable_type", "Rooler::Rule"], ["rule_id", 141], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 140))))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 142], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 142))))  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 142 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 142) LIMIT 1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["deliverable_id", 142], ["deliverable_type", "Rooler::Rule"], ["rule_id", 142], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 142))))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 143], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 143 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 143) LIMIT 1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["deliverable_id", 143], ["deliverable_type", "Rooler::Rule"], ["rule_id", 143], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 143 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 143) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 144], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 145], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:42:51 UTC +00:00], ["name", "rule-8"], ["template_id", 146], ["updated_at", Wed, 26 Feb 2014 14:53:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.6ms) 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", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 147], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 148], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 148))))  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 149], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 149)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 149)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 149 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Rooler::Rule"], ["rule_id", 149], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 148))))  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 150], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 150))))  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 150 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 150) LIMIT 1 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", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["deliverable_id", 150], ["deliverable_type", "Rooler::Rule"], ["rule_id", 150], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 150))))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 151], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 151 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1 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", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Rooler::Rule"], ["rule_id", 151], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 151 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-6"], ["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 152], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 153], ["updated_at", Wed, 26 Feb 2014 14:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:55:47 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:55:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:55:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:44:47 UTC +00:00], ["name", "rule-8"], ["template_id", 154], ["updated_at", Wed, 26 Feb 2014 14:55:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 155], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 156], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 156))))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 157], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 157)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 156 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 157) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["deliverable_id", 157], ["deliverable_type", "Rooler::Rule"], ["rule_id", 156], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 156))))  (0.4ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 158], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 158))))  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 158 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1 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", Wed, 26 Feb 2014 14:57:25 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Rooler::Rule"], ["rule_id", 158], ["updated_at", Wed, 26 Feb 2014 14:57:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 158))))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 159], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 159 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 159) LIMIT 1 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", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["deliverable_id", 159], ["deliverable_type", "Rooler::Rule"], ["rule_id", 159], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 159 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 159) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 160], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 161], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:46:26 UTC +00:00], ["name", "rule-8"], ["template_id", 162], ["updated_at", Wed, 26 Feb 2014 14:57:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (10.6ms) 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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 163], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 164], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 165], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 165))))  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 165 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 165) LIMIT 1 SQL (1.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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["deliverable_id", 165], ["deliverable_type", "Rooler::Rule"], ["rule_id", 165], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 165))))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 166], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 166 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 166) LIMIT 1 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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["deliverable_id", 166], ["deliverable_type", "Rooler::Rule"], ["rule_id", 166], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 166 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 166) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 167], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 168], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:51:07 UTC +00:00], ["name", "rule-7"], ["template_id", 169], ["updated_at", Wed, 26 Feb 2014 15:02:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 170], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 171], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 171))))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 172], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 172)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 171 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 172) LIMIT 1 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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["deliverable_id", 172], ["deliverable_type", "Rooler::Rule"], ["rule_id", 171], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 173], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 173))))  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 173 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1 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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Rooler::Rule"], ["rule_id", 173], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 173))))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 174], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 174 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 174) LIMIT 1 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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["deliverable_id", 174], ["deliverable_type", "Rooler::Rule"], ["rule_id", 174], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 174 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 174) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 175], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 176], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:51:44 UTC +00:00], ["name", "rule-8"], ["template_id", 177], ["updated_at", Wed, 26 Feb 2014 15:02:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 178], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 179], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (2.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 179))))  (0.4ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 180], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 180)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 179 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 180) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["deliverable_id", 180], ["deliverable_type", "Rooler::Rule"], ["rule_id", 179], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 179))))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 181], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 181))))  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 181 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 181) LIMIT 1 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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["deliverable_id", 181], ["deliverable_type", "Rooler::Rule"], ["rule_id", 181], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 181))))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 182], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 182 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 182) LIMIT 1 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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["deliverable_id", 182], ["deliverable_type", "Rooler::Rule"], ["rule_id", 182], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 182 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 182) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 183], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 184], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:52:11 UTC +00:00], ["name", "rule-8"], ["template_id", 185], ["updated_at", Wed, 26 Feb 2014 15:03:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.1ms) 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 186], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 187], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (2.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 187))))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 188], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 188)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 189], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 189))))  (0.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 189 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 189) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["deliverable_id", 189], ["deliverable_type", "Rooler::Rule"], ["rule_id", 189], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 189))))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 190], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 190 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 190) LIMIT 1 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["deliverable_id", 190], ["deliverable_type", "Rooler::Rule"], ["rule_id", 190], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 190 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 190) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 191], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 192], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:52:56 UTC +00:00], ["name", "rule-8"], ["template_id", 193], ["updated_at", Wed, 26 Feb 2014 15:03:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 194], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 195], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 195))))  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 196], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 196)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 195 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 196) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["deliverable_id", 196], ["deliverable_type", "Rooler::Rule"], ["rule_id", 195], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 195)))) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 195))))  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-4"], ["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 197], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 197))))  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 197 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1 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", Wed, 26 Feb 2014 15:04:42 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Rooler::Rule"], ["rule_id", 197], ["updated_at", Wed, 26 Feb 2014 15:04:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 197))))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 198], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 198 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 198) LIMIT 1 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", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["deliverable_id", 198], ["deliverable_type", "Rooler::Rule"], ["rule_id", 198], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 198 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 198) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 199], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 200], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:53:43 UTC +00:00], ["name", "rule-8"], ["template_id", 201], ["updated_at", Wed, 26 Feb 2014 15:04:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.6ms) 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", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 202], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 203], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (2.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 203))))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 204], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 204)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 205], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (50.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 205))))  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 205 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 205) LIMIT 1 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", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["deliverable_id", 205], ["deliverable_type", "Rooler::Rule"], ["rule_id", 205], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 205))))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 206], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1 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", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["deliverable_id", 206], ["deliverable_type", "Rooler::Rule"], ["rule_id", 206], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 207], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 208], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:54:12 UTC +00:00], ["name", "rule-8"], ["template_id", 209], ["updated_at", Wed, 26 Feb 2014 15:05:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 210], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 211], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 211))))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 212], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 212)))) ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 211 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 212) LIMIT 1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["deliverable_id", 212], ["deliverable_type", "Rooler::Rule"], ["rule_id", 211], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 211))))  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 213], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 213))))  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 213 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 213) LIMIT 1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["deliverable_id", 213], ["deliverable_type", "Rooler::Rule"], ["rule_id", 213], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (NOT (EXISTS (SELECT "rooler_rules".* FROM "rooler_rules" INNER JOIN "rooler_deliveries" ON "rooler_deliveries"."rule_id" = "rooler_rules"."id" WHERE (rooler_deliveries.rule_id = 213))))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 214], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 214 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 214) LIMIT 1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["deliverable_id", 214], ["deliverable_type", "Rooler::Rule"], ["rule_id", 214], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 214 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 214) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 215], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 216], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 14:54:57 UTC +00:00], ["name", "rule-8"], ["template_id", 217], ["updated_at", Wed, 26 Feb 2014 15:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 218], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 219], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 220], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 221], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 221 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Rooler::Rule"], ["rule_id", 221], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 221 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-5"], ["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 222], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 223], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:28:12 UTC +00:00], ["name", "rule-7"], ["template_id", 224], ["updated_at", Wed, 26 Feb 2014 15:39:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 225], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 226], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."klass_name" = 'Rooler::Rule' [["rule_id", 226]] PG::UndefinedColumn: ERROR: column rooler_deliveries.klass_name does not exist LINE 1: ...es" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_de... ^ : SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."klass_name" = 'Rooler::Rule'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 227], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 228], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 228 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 228) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00], ["deliverable_id", 228], ["deliverable_type", "Rooler::Rule"], ["rule_id", 228], ["updated_at", Wed, 26 Feb 2014 15:43:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 228 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 228) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:43:14 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 229], ["updated_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 230], ["updated_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:32:14 UTC +00:00], ["name", "rule-7"], ["template_id", 231], ["updated_at", Wed, 26 Feb 2014 15:43:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 232], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 233], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (37.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", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 234], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 235], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 235 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Rooler::Rule"], ["rule_id", 235], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 235 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 236], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 237], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:32:56 UTC +00:00], ["name", "rule-7"], ["template_id", 238], ["updated_at", Wed, 26 Feb 2014 15:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.4ms) 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", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 239], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 240], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."klass_name" = 'Rooler::Rule' [["rule_id", 240]] PG::UndefinedColumn: ERROR: column rooler_deliveries.klass_name does not exist LINE 1: ...es" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_de... ^ : SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."klass_name" = 'Rooler::Rule'  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 241], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 242], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 242) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["deliverable_id", 242], ["deliverable_type", "Rooler::Rule"], ["rule_id", 242], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 242) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 243], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 244], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:33:44 UTC +00:00], ["name", "rule-7"], ["template_id", 245], ["updated_at", Wed, 26 Feb 2014 15:44:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 246], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 247], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 247]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 248], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 249], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 249 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 249) LIMIT 1 SQL (1.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", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["deliverable_id", 249], ["deliverable_type", "Rooler::Rule"], ["rule_id", 249], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 249 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 249) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 250], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 251], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:34:36 UTC +00:00], ["name", "rule-7"], ["template_id", 252], ["updated_at", Wed, 26 Feb 2014 15:45:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) 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", Wed, 26 Feb 2014 15:45:59 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 253], ["updated_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 254], ["updated_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 254]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "load"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 255], ["updated_at", Wed, 26 Feb 2014 15:45:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 256], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 256 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 256) LIMIT 1 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", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["deliverable_id", 256], ["deliverable_type", "Rooler::Rule"], ["rule_id", 256], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 256 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 256) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 257], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 258], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:35:00 UTC +00:00], ["name", "rule-7"], ["template_id", 259], ["updated_at", Wed, 26 Feb 2014 15:46:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Wed, 26 Feb 2014 15:46:34 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 260], ["updated_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 261], ["updated_at", Wed, 26 Feb 2014 15:46:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 261]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 262], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 262]] Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 263], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 263 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 263) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["deliverable_id", 263], ["deliverable_type", "Rooler::Rule"], ["rule_id", 263], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 263 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 263) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 264], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 265], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:35:35 UTC +00:00], ["name", "rule-7"], ["template_id", 266], ["updated_at", Wed, 26 Feb 2014 15:46:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.5ms) 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", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 267], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 268], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 268]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 269], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 269]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 270], ["updated_at", Wed, 26 Feb 2014 15:47:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 270 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 270) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["deliverable_id", 270], ["deliverable_type", "Rooler::Rule"], ["rule_id", 270], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 270 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 270) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 271], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 272], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:36:08 UTC +00:00], ["name", "rule-7"], ["template_id", 273], ["updated_at", Wed, 26 Feb 2014 15:47:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.3ms) 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 274], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 275], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 275]] Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 276], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 276]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 277], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 277]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 277 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 277) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["deliverable_id", 277], ["deliverable_type", "Rooler::Rule"], ["rule_id", 277], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 277]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 277 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 277) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 278], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 278) LIMIT 1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["deliverable_id", 278], ["deliverable_type", "Rooler::Rule"], ["rule_id", 278], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 278) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 279], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 280], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:36:30 UTC +00:00], ["name", "rule-8"], ["template_id", 281], ["updated_at", Wed, 26 Feb 2014 15:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 282], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 283], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (1.5ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 283]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 284], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 284]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 283 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 284) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["deliverable_id", 284], ["deliverable_type", "Rooler::Rule"], ["rule_id", 283], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 283]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 285], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 285]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 285 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 285) LIMIT 1 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", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["deliverable_id", 285], ["deliverable_type", "Rooler::Rule"], ["rule_id", 285], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 285]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 285 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 285) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 286], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 286 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 286) LIMIT 1 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", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["deliverable_id", 286], ["deliverable_type", "Rooler::Rule"], ["rule_id", 286], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 286 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 286) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 287], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 288], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:37:37 UTC +00:00], ["name", "rule-8"], ["template_id", 289], ["updated_at", Wed, 26 Feb 2014 15:48:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 290], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 291], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (2.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 291]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 292], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 292]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 291 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 292) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["deliverable_id", 292], ["deliverable_type", "Rooler::Rule"], ["rule_id", 291], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 291]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 293], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 293]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 293 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 293) LIMIT 1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["deliverable_id", 293], ["deliverable_type", "Rooler::Rule"], ["rule_id", 293], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 293]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 294], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 294 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 294) LIMIT 1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["deliverable_id", 294], ["deliverable_type", "Rooler::Rule"], ["rule_id", 294], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 294 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 294) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 295], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 296], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:39:31 UTC +00:00], ["name", "rule-8"], ["template_id", 297], ["updated_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (11.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", Wed, 26 Feb 2014 16:01:30 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 298], ["updated_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (1.0ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Wed, 26 Feb 2014 16:01:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (4.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 299], ["updated_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 299]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 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-3"], ["created_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 300], ["updated_at", Wed, 26 Feb 2014 16:01:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 300]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 301], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 301 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 301) LIMIT 1 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", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["deliverable_id", 301], ["deliverable_type", "Rooler::Rule"], ["rule_id", 301], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 301 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 301) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 302], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 303], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:50:31 UTC +00:00], ["name", "rule-7"], ["template_id", 304], ["updated_at", Wed, 26 Feb 2014 16:01:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.4ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.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", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 305], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 306], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 307], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 308], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 308 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 308) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["deliverable_id", 308], ["deliverable_type", "Rooler::Rule"], ["rule_id", 308], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 308 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 308) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 309], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 310], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 15:56:51 UTC +00:00], ["name", "rule-7"], ["template_id", 311], ["updated_at", Wed, 26 Feb 2014 16:07:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 312], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 313], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 313]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-3"], ["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 314], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 314]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 315], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 315 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 315) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["deliverable_id", 315], ["deliverable_type", "Rooler::Rule"], ["rule_id", 315], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 315 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 315) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 316], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 317], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:04:47 UTC +00:00], ["name", "rule-7"], ["template_id", 318], ["updated_at", Wed, 26 Feb 2014 16:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) 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", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 319], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 320], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 320]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 321], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 321]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 322], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 322 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["deliverable_id", 322], ["deliverable_type", "Rooler::Rule"], ["rule_id", 322], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 322 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 323], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 324], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:07:39 UTC +00:00], ["name", "rule-7"], ["template_id", 325], ["updated_at", Wed, 26 Feb 2014 16:18:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.6ms) 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", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 326], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 327], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 327]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 328], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 328]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 329], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 329 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 329) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["deliverable_id", 329], ["deliverable_type", "Rooler::Rule"], ["rule_id", 329], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 329 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 329) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 330], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 331], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:09:46 UTC +00:00], ["name", "rule-7"], ["template_id", 332], ["updated_at", Wed, 26 Feb 2014 16:20:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 333], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 334], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 334]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-3"], ["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 335], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 335]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (NULL))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 336], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 336 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 336) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["deliverable_id", 336], ["deliverable_type", "Rooler::Rule"], ["rule_id", 336], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 336 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 336) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 337], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 338], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:13:20 UTC +00:00], ["name", "rule-7"], ["template_id", 339], ["updated_at", Wed, 26 Feb 2014 16:24:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 340], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 341], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 341]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 342], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 342]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 343], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 343]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 343 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 343) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["deliverable_id", 343], ["deliverable_type", "Rooler::Rule"], ["rule_id", 343], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 343]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (343))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 344], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 344 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 344) LIMIT 1 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", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["deliverable_id", 344], ["deliverable_type", "Rooler::Rule"], ["rule_id", 344], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 344 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 344) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 345], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 346], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:26:07 UTC +00:00], ["name", "rule-8"], ["template_id", 347], ["updated_at", Wed, 26 Feb 2014 16:37:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) 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", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 348], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 349], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 349]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 350], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 350]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 351], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 351 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 351) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["deliverable_id", 351], ["deliverable_type", "Rooler::Rule"], ["rule_id", 351], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 351 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 351) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 352], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 353], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:28:31 UTC +00:00], ["name", "rule-7"], ["template_id", 354], ["updated_at", Wed, 26 Feb 2014 16:39:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 355], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 356], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 356]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 357], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 357]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 358], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 358]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 358 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 358) LIMIT 1 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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["deliverable_id", 358], ["deliverable_type", "Rooler::Rule"], ["rule_id", 358], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 358]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (358))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 359], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 359 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 359) LIMIT 1 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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["deliverable_id", 359], ["deliverable_type", "Rooler::Rule"], ["rule_id", 359], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 359 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 359) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 360], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 361], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:28:51 UTC +00:00], ["name", "rule-8"], ["template_id", 362], ["updated_at", Wed, 26 Feb 2014 16:39:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.6ms) 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 363], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 364], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 364]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 365], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 365]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 364 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 365) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["deliverable_id", 365], ["deliverable_type", "Rooler::Rule"], ["rule_id", 364], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 364]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (365))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 366], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 366]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 366 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 366) LIMIT 1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["deliverable_id", 366], ["deliverable_type", "Rooler::Rule"], ["rule_id", 366], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 366]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (366))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 367], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 367) LIMIT 1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["deliverable_id", 367], ["deliverable_type", "Rooler::Rule"], ["rule_id", 367], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 367) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 368], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 369], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:30:09 UTC +00:00], ["name", "rule-8"], ["template_id", 370], ["updated_at", Wed, 26 Feb 2014 16:41:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.5ms) 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", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 371], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 372], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 372]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 373], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 373]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 374], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 374 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 374) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["deliverable_id", 374], ["deliverable_type", "Rooler::Rule"], ["rule_id", 374], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 374 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 374) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 375], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 376], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:30:38 UTC +00:00], ["name", "rule-7"], ["template_id", 377], ["updated_at", Wed, 26 Feb 2014 16:41:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 378], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 379], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 379]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 380], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 380]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) 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" = 380) LIMIT 1 SQL (1.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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["deliverable_id", 380], ["deliverable_type", "Rooler::Rule"], ["rule_id", 379], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 379]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (380))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 381], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 381]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 381 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 381) LIMIT 1 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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["deliverable_id", 381], ["deliverable_type", "Rooler::Rule"], ["rule_id", 381], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 381]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (381))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 382], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 382 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 382) LIMIT 1 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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["deliverable_id", 382], ["deliverable_type", "Rooler::Rule"], ["rule_id", 382], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 382 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 382) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 383], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 384], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:31:01 UTC +00:00], ["name", "rule-8"], ["template_id", 385], ["updated_at", Wed, 26 Feb 2014 16:42:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:43:31 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 386], ["updated_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 387], ["updated_at", Wed, 26 Feb 2014 16:43:31 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 387]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 388], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 388]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 387 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 388) LIMIT 1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["deliverable_id", 388], ["deliverable_type", "Rooler::Rule"], ["rule_id", 387], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 387]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (388))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 389], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 389]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 389 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 389) LIMIT 1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["deliverable_id", 389], ["deliverable_type", "Rooler::Rule"], ["rule_id", 389], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 389]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (389))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 390], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 390 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 390) LIMIT 1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["deliverable_id", 390], ["deliverable_type", "Rooler::Rule"], ["rule_id", 390], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 390 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 390) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 391], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 392], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:32:32 UTC +00:00], ["name", "rule-8"], ["template_id", 393], ["updated_at", Wed, 26 Feb 2014 16:43:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 394], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 395], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 395]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 396], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 396]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 395 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 396) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["deliverable_id", 396], ["deliverable_type", "Rooler::Rule"], ["rule_id", 395], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 395]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (396))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 397], ["updated_at", Wed, 26 Feb 2014 16:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 397]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 397 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 397) LIMIT 1 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", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["deliverable_id", 397], ["deliverable_type", "Rooler::Rule"], ["rule_id", 397], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 397]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (397))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 398], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 398 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 398) LIMIT 1 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", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["deliverable_id", 398], ["deliverable_type", "Rooler::Rule"], ["rule_id", 398], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 398 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 398) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 399], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 400], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:33:07 UTC +00:00], ["name", "rule-8"], ["template_id", 401], ["updated_at", Wed, 26 Feb 2014 16:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.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", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 402], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 403], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 403]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 404], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 404]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 403 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 404) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["deliverable_id", 404], ["deliverable_type", "Rooler::Rule"], ["rule_id", 403], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 403]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (404))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 405], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 405]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 405 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 405) LIMIT 1 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", Wed, 26 Feb 2014 16:44:22 UTC +00:00], ["deliverable_id", 405], ["deliverable_type", "Rooler::Rule"], ["rule_id", 405], ["updated_at", Wed, 26 Feb 2014 16:44:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 405]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (405))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 406], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 406 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 406) LIMIT 1 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", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["deliverable_id", 406], ["deliverable_type", "Rooler::Rule"], ["rule_id", 406], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 406 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 406) LIMIT 1  (0.6ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 407], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 408], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:33:23 UTC +00:00], ["name", "rule-8"], ["template_id", 409], ["updated_at", Wed, 26 Feb 2014 16:44:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (10.0ms) 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 410], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 411], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 411]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 412], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 412]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) 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" = 412) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["deliverable_id", 412], ["deliverable_type", "Rooler::Rule"], ["rule_id", 411], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 411]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (412))  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 413], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 413]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 413 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 413) LIMIT 1 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["deliverable_id", 413], ["deliverable_type", "Rooler::Rule"], ["rule_id", 413], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 413]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (413))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 414], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 414 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 414) LIMIT 1 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["deliverable_id", 414], ["deliverable_type", "Rooler::Rule"], ["rule_id", 414], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 414 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 414) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 415], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 416], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Wed, 26 Feb 2014 16:34:12 UTC +00:00], ["name", "rule-8"], ["template_id", 417], ["updated_at", Wed, 26 Feb 2014 16:45:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (42.1ms) 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", Thu, 27 Feb 2014 10:44:06 UTC +00:00], ["name", "template-1"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 418], ["updated_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00], ["name", "template-2"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 419], ["updated_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 419]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00], ["name", "template-3"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 420], ["updated_at", Thu, 27 Feb 2014 10:44:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 420]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 419 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 420) LIMIT 1 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", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["deliverable_id", 420], ["deliverable_type", "Rooler::Rule"], ["rule_id", 419], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 419]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (420))  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["name", "template-4"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 421], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 421]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 421 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 421) LIMIT 1 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", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["deliverable_id", 421], ["deliverable_type", "Rooler::Rule"], ["rule_id", 421], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 421]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (421))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["name", "template-5"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 422], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 422 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 422) LIMIT 1 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", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["deliverable_id", 422], ["deliverable_type", "Rooler::Rule"], ["rule_id", 422], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 422 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 422) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["name", "template-6"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 423], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["name", "template-7"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 424], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["name", "template-8"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 10:33:07 UTC +00:00], ["name", "rule-8"], ["template_id", 425], ["updated_at", Thu, 27 Feb 2014 10:44:07 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 426], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 426 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 426) LIMIT 1 SQL (1.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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["deliverable_id", 426], ["deliverable_type", "Rooler::Rule"], ["rule_id", 426], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (15.4ms) 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", 426]]  (0.5ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 427], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 428], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 428]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 429], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 429]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 428 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 429) LIMIT 1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["deliverable_id", 429], ["deliverable_type", "Rooler::Rule"], ["rule_id", 428], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 428]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (429))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 430], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 430]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 430 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 430) LIMIT 1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["deliverable_id", 430], ["deliverable_type", "Rooler::Rule"], ["rule_id", 430], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 430]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (430))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 431], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 431 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 431) LIMIT 1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["deliverable_id", 431], ["deliverable_type", "Rooler::Rule"], ["rule_id", 431], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 431 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 431) LIMIT 1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 432], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 433], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 11:15:52 UTC +00:00], ["name", "rule-8"], ["template_id", 434], ["updated_at", Thu, 27 Feb 2014 11:26:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (42.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 435], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 435 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 435) LIMIT 1 SQL (1.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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["deliverable_id", 435], ["deliverable_type", "Rooler::Rule"], ["rule_id", 435], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (4.0ms) 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", 435]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 436], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 437], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 437]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 438], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 438]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 437 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 438) LIMIT 1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["deliverable_id", 438], ["deliverable_type", "Rooler::Rule"], ["rule_id", 437], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 437]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (438))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 439], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 439]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 439 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 439) LIMIT 1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["deliverable_id", 439], ["deliverable_type", "Rooler::Rule"], ["rule_id", 439], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 439]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (439))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 440], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 440 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 440) LIMIT 1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["deliverable_id", 440], ["deliverable_type", "Rooler::Rule"], ["rule_id", 440], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 440 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 440) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 441], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 442], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 11:24:35 UTC +00:00], ["name", "rule-8"], ["template_id", 443], ["updated_at", Thu, 27 Feb 2014 11:35:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 444], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 444 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 444) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["deliverable_id", 444], ["deliverable_type", "Rooler::Rule"], ["rule_id", 444], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 444]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 445], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 446], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 446]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 447], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 447]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 446 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 447) LIMIT 1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["deliverable_id", 447], ["deliverable_type", "Rooler::Rule"], ["rule_id", 446], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 446]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (447))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 448], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 448]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 448 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 448) LIMIT 1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["deliverable_id", 448], ["deliverable_type", "Rooler::Rule"], ["rule_id", 448], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 448]] Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (448))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 449], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 449 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 449) LIMIT 1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["deliverable_id", 449], ["deliverable_type", "Rooler::Rule"], ["rule_id", 449], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 449 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 449) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 450], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 451], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (2.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 11:25:42 UTC +00:00], ["name", "rule-8"], ["template_id", 452], ["updated_at", Thu, 27 Feb 2014 11:36:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 453], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 453 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 453) LIMIT 1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["deliverable_id", 453], ["deliverable_type", "Rooler::Rule"], ["rule_id", 453], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 453]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.8ms) Sent mail to @to.com (78.1ms) Date: Thu, 27 Feb 2014 12:37:11 +0100 From: from@example.com to: @to.com cc: @cc.com Message-ID: <530f23679b07d_300a3fcf49835ad83454e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is:  (0.5ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 454], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 455], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 455]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 456], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 456]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 455 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 456) LIMIT 1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["deliverable_id", 456], ["deliverable_type", "Rooler::Rule"], ["rule_id", 455], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 455]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (456))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 457], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 457]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 457 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 457) LIMIT 1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["deliverable_id", 457], ["deliverable_type", "Rooler::Rule"], ["rule_id", 457], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 457]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (457))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 458], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 458 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 458) LIMIT 1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["deliverable_id", 458], ["deliverable_type", "Rooler::Rule"], ["rule_id", 458], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 458 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 458) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 459], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 460], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 11:26:11 UTC +00:00], ["name", "rule-8"], ["template_id", 461], ["updated_at", Thu, 27 Feb 2014 11:37:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 462], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 462 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 462) LIMIT 1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["deliverable_id", 462], ["deliverable_type", "Rooler::Rule"], ["rule_id", 462], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 462]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.5ms) Sent mail to Liquid error: undefined method `to_liquid' for #@to.com (69.8ms) Date: Thu, 27 Feb 2014 12:38:34 +0100 From: from@example.com to: Liquid error: undefined method `to_liquid' for #@to.com cc: Liquid error: undefined method `to_liquid' for #@cc.com Message-ID: <530f23ba52880_301a3fc0cd835ae08046@Yonahs-MacBook-Pro.local.mail> Subject: subject is: Liquid error: undefined method `to_liquid' for # Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: Liquid error: undefined method `to_liquid' for #  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 463], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 464], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 464]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 465], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 465]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 464 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 465) LIMIT 1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["deliverable_id", 465], ["deliverable_type", "Rooler::Rule"], ["rule_id", 464], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 464]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (465))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 466], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 466]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 466 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 466) LIMIT 1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["deliverable_id", 466], ["deliverable_type", "Rooler::Rule"], ["rule_id", 466], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 466]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (466))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 467], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 467 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 467) LIMIT 1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["deliverable_id", 467], ["deliverable_type", "Rooler::Rule"], ["rule_id", 467], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 467 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 467) LIMIT 1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 468], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 469], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 11:27:34 UTC +00:00], ["name", "rule-8"], ["template_id", 470], ["updated_at", Thu, 27 Feb 2014 11:38:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 471], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 471 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 471) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["deliverable_id", 471], ["deliverable_type", "Rooler::Rule"], ["rule_id", 471], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 471]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.3ms) Sent mail to test_name@to.com (23.8ms) Date: Thu, 27 Feb 2014 12:44:26 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f251a78b25_304f3fe080835ae028472@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.6ms) 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 472], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 473], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 473]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 474], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 474]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 473 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 474) LIMIT 1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["deliverable_id", 474], ["deliverable_type", "Rooler::Rule"], ["rule_id", 473], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 473]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (474))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 475], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 475]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 475 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 475) LIMIT 1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["deliverable_id", 475], ["deliverable_type", "Rooler::Rule"], ["rule_id", 475], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 475]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (475))  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 476], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 476 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 476) LIMIT 1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["deliverable_id", 476], ["deliverable_type", "Rooler::Rule"], ["rule_id", 476], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 476 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 476) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 477], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 478], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 11:33:26 UTC +00:00], ["name", "rule-8"], ["template_id", 479], ["updated_at", Thu, 27 Feb 2014 11:44:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------- RoolerTest: test_truth ----------------------  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 480], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 480 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 480) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["deliverable_id", 480], ["deliverable_type", "Rooler::Rule"], ["rule_id", 480], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 480]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.6ms) Sent mail to test_name@to.com (24.0ms) Date: Thu, 27 Feb 2014 13:19:03 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f2d3750a0f_31af3fe111835ae0882dc@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 481], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 482], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 482]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 483], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 483]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 482 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 483) LIMIT 1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["deliverable_id", 483], ["deliverable_type", "Rooler::Rule"], ["rule_id", 482], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 482]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (483))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 484], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 484]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 484 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 484) LIMIT 1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["deliverable_id", 484], ["deliverable_type", "Rooler::Rule"], ["rule_id", 484], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 484]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (484))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 485], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 485 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 485) LIMIT 1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["deliverable_id", 485], ["deliverable_type", "Rooler::Rule"], ["rule_id", 485], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 485 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 485) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 486], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 487], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:08:03 UTC +00:00], ["name", "rule-8"], ["template_id", 488], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 489], ["updated_at", Thu, 27 Feb 2014 12:19:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:19:22 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:19:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:22 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 490], ["updated_at", Thu, 27 Feb 2014 12:19:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 490 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 490) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:22 UTC +00:00], ["deliverable_id", 490], ["deliverable_type", "Rooler::Rule"], ["rule_id", 490], ["updated_at", Thu, 27 Feb 2014 12:19:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 490]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.6ms) Sent mail to test_name@to.com (25.7ms) Date: Thu, 27 Feb 2014 13:19:23 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f2d4bc711_31b53fc1d5435ae010663@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 491], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 492], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 492]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 493], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 493]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 492 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 493) LIMIT 1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["deliverable_id", 493], ["deliverable_type", "Rooler::Rule"], ["rule_id", 492], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 492]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (493))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 494], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 494]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 494 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 494) LIMIT 1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["deliverable_id", 494], ["deliverable_type", "Rooler::Rule"], ["rule_id", 494], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 494]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (494))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 495], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 495 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 495) LIMIT 1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["deliverable_id", 495], ["deliverable_type", "Rooler::Rule"], ["rule_id", 495], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 495 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 495) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 496], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------ Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago ------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 497], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:08:23 UTC +00:00], ["name", "rule-8"], ["template_id", 498], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 499], ["updated_at", Thu, 27 Feb 2014 12:19:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.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", Thu, 27 Feb 2014 12:21:48 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 500], ["updated_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 500 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 500) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00], ["deliverable_id", 500], ["deliverable_type", "Rooler::Rule"], ["rule_id", 500], ["updated_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 500]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (52.0ms) Sent mail to test_name@to.com (33.9ms) Date: Thu, 27 Feb 2014 13:21:48 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f2ddcea39b_31f13fdff4435ad08601c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:21:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 501], ["updated_at", Thu, 27 Feb 2014 12:21:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 502], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 502]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-3"], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 503], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 503]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 502 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 503) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["deliverable_id", 503], ["deliverable_type", "Rooler::Rule"], ["rule_id", 502], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 502]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (503))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 504], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 504]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 504 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 504) LIMIT 1 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", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["deliverable_id", 504], ["deliverable_type", "Rooler::Rule"], ["rule_id", 504], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 504]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (504))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 505], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 505 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 505) LIMIT 1 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", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["deliverable_id", 505], ["deliverable_type", "Rooler::Rule"], ["rule_id", 505], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 505 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 505) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 506], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 507], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:10:49 UTC +00:00], ["name", "rule-8"], ["template_id", 508], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 509], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.8ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-10"], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 510], ["updated_at", Thu, 27 Feb 2014 12:21:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:24:36 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:24:36 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:36 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 511], ["updated_at", Thu, 27 Feb 2014 12:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 511 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 511) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:36 UTC +00:00], ["deliverable_id", 511], ["deliverable_type", "Rooler::Rule"], ["rule_id", 511], ["updated_at", Thu, 27 Feb 2014 12:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 511]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.0ms) Sent mail to test_name@to.com (27.9ms) Date: Thu, 27 Feb 2014 13:24:37 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f2e851ec24_320b3ff1c5035ad8233cb@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 512], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 513], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 513]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 514], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 514]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 513 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 514) LIMIT 1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["deliverable_id", 514], ["deliverable_type", "Rooler::Rule"], ["rule_id", 513], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 513]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (514))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 515], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 515]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 515 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 515) LIMIT 1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["deliverable_id", 515], ["deliverable_type", "Rooler::Rule"], ["rule_id", 515], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 515]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (515))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 516], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 516 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 516) LIMIT 1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["deliverable_id", 516], ["deliverable_type", "Rooler::Rule"], ["rule_id", 516], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 516 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 516) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 517], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 518], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:13:37 UTC +00:00], ["name", "rule-8"], ["template_id", 519], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 520], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 521], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 521]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 521 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 521) LIMIT 1 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", Thu, 27 Feb 2014 12:24:37 UTC +00:00], ["deliverable_id", 521], ["deliverable_type", "Rooler::Rule"], ["rule_id", 521], ["updated_at", Thu, 27 Feb 2014 12:24:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (9.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:26:03 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:26:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 522], ["updated_at", Thu, 27 Feb 2014 12:26:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 522 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 522) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["deliverable_id", 522], ["deliverable_type", "Rooler::Rule"], ["rule_id", 522], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 522]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.9ms) Sent mail to test_name@to.com (29.2ms) Date: Thu, 27 Feb 2014 13:26:04 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f2edc2289b_32183fcccdc35ad0585ea@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 523], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 524], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 524]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 525], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 525]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 524 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 525) LIMIT 1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["deliverable_id", 525], ["deliverable_type", "Rooler::Rule"], ["rule_id", 524], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 524]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (525))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 526], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 526]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 526 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 526) LIMIT 1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["deliverable_id", 526], ["deliverable_type", "Rooler::Rule"], ["rule_id", 526], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 526]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (526))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 527], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 527 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 527) LIMIT 1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["deliverable_id", 527], ["deliverable_type", "Rooler::Rule"], ["rule_id", 527], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 527 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 527) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 528], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 529], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:15:04 UTC +00:00], ["name", "rule-8"], ["template_id", 530], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 531], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 532], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 532]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 532 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 532) LIMIT 1 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", Thu, 27 Feb 2014 12:26:04 UTC +00:00], ["deliverable_id", 532], ["deliverable_type", "Rooler::Rule"], ["rule_id", 532], ["updated_at", Thu, 27 Feb 2014 12:26:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 27 Feb 2014 12:26:28 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:26:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 533], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 533 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 533) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["deliverable_id", 533], ["deliverable_type", "Rooler::Rule"], ["rule_id", 533], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 533]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.9ms) Sent mail to test_name@to.com (29.8ms) Date: Thu, 27 Feb 2014 13:26:29 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f2ef53fabb_321f3fec3a035adc81438@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 534], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 535], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 535]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (1.0ms) SAVEPOINT active_record_1 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-3"], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 536], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 536]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 535 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 536) LIMIT 1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["deliverable_id", 536], ["deliverable_type", "Rooler::Rule"], ["rule_id", 535], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 535]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (536))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 537], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 537]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 537 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 537) LIMIT 1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["deliverable_id", 537], ["deliverable_type", "Rooler::Rule"], ["rule_id", 537], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 537]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (537))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 538], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 538 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 538) LIMIT 1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["deliverable_id", 538], ["deliverable_type", "Rooler::Rule"], ["rule_id", 538], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 538 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 538) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 539], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 540], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:15:29 UTC +00:00], ["name", "rule-8"], ["template_id", 541], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 542], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 543], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 543]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 543 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 543) LIMIT 1 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", Thu, 27 Feb 2014 12:26:29 UTC +00:00], ["deliverable_id", 543], ["deliverable_type", "Rooler::Rule"], ["rule_id", 543], ["updated_at", Thu, 27 Feb 2014 12:26:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 543]]  (0.2ms) ROLLBACK  (0.5ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:32:03 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:32:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:03 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 544], ["updated_at", Thu, 27 Feb 2014 12:32:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 544 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 544) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["deliverable_id", 544], ["deliverable_type", "Rooler::Rule"], ["rule_id", 544], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.0ms) 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", 544]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.2ms) Sent mail to test_name@to.com (24.1ms) Date: Thu, 27 Feb 2014 13:32:04 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f304425857_32503fd57cc35adc9976@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 545], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 546], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 546]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 547], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 547]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 546 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 547) LIMIT 1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["deliverable_id", 547], ["deliverable_type", "Rooler::Rule"], ["rule_id", 546], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 546]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (547))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 548], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 548]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 548 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 548) LIMIT 1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["deliverable_id", 548], ["deliverable_type", "Rooler::Rule"], ["rule_id", 548], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 548]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (548))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 549], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 549 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 549) LIMIT 1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["deliverable_id", 549], ["deliverable_type", "Rooler::Rule"], ["rule_id", 549], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 549 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 549) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 550], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 551], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:21:04 UTC +00:00], ["name", "rule-8"], ["template_id", 552], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 553], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 554], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 555], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 554 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 555) LIMIT 1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["deliverable_id", 555], ["deliverable_type", "Rooler::Rule"], ["rule_id", 554], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 554]] 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", 555]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to (6.5ms) Date: Thu, 27 Feb 2014 13:32:04 +0100 From: from@example.com Message-ID: <530f3044599d7_32503fd57cc35adc9988@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 556], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 556]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 556 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 556) LIMIT 1 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", Thu, 27 Feb 2014 12:32:04 UTC +00:00], ["deliverable_id", 556], ["deliverable_type", "Rooler::Rule"], ["rule_id", 556], ["updated_at", Thu, 27 Feb 2014 12:32:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 556]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 557], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 557 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 557) LIMIT 1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["deliverable_id", 557], ["deliverable_type", "Rooler::Rule"], ["rule_id", 557], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 557]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.6ms) Sent mail to test_name@to.com (23.1ms) Date: Thu, 27 Feb 2014 13:35:01 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f30f5c129e_32723ff195c35ad41344d@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 558], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 559], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 559]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 560], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 560]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 559 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 560) LIMIT 1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["deliverable_id", 560], ["deliverable_type", "Rooler::Rule"], ["rule_id", 559], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 559]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (560))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 561], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 561]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 561 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 561) LIMIT 1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["deliverable_id", 561], ["deliverable_type", "Rooler::Rule"], ["rule_id", 561], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 561]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (561))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 562], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 562 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 562) LIMIT 1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["deliverable_id", 562], ["deliverable_type", "Rooler::Rule"], ["rule_id", 562], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 562 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 562) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 563], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 564], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:24:01 UTC +00:00], ["name", "rule-8"], ["template_id", 565], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 566], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 567], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 568], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 567 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 568) LIMIT 1 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", Thu, 27 Feb 2014 12:35:01 UTC +00:00], ["deliverable_id", 568], ["deliverable_type", "Rooler::Rule"], ["rule_id", 567], ["updated_at", Thu, 27 Feb 2014 12:35:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 567]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 568]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to (6.3ms) Date: Thu, 27 Feb 2014 13:35:02 +0100 From: from@example.com Message-ID: <530f30f6543e_32723ff195c35ad4135c8@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 27 Feb 2014 12:35:02 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "{{user.email}}"], ["updated_at", Thu, 27 Feb 2014 12:35:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:35:02 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 569], ["updated_at", Thu, 27 Feb 2014 12:35:02 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 569]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 569 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 569) LIMIT 1 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", Thu, 27 Feb 2014 12:35:02 UTC +00:00], ["deliverable_id", 569], ["deliverable_type", "Rooler::Rule"], ["rule_id", 569], ["updated_at", Thu, 27 Feb 2014 12:35:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 569]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 570], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 570 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 570) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["deliverable_id", 570], ["deliverable_type", "Rooler::Rule"], ["rule_id", 570], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 570]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.0ms) Sent mail to test_name@to.com (23.3ms) Date: Thu, 27 Feb 2014 13:36:10 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f313a733e9_32823fede1c35adc219bb@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 571], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 572], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 572]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 573], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 573]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 572 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 573) LIMIT 1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["deliverable_id", 573], ["deliverable_type", "Rooler::Rule"], ["rule_id", 572], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 572]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (573))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 574], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 574]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 574 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 574) LIMIT 1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["deliverable_id", 574], ["deliverable_type", "Rooler::Rule"], ["rule_id", 574], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 574]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (574))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 575], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 575 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 575) LIMIT 1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["deliverable_id", 575], ["deliverable_type", "Rooler::Rule"], ["rule_id", 575], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 575 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 575) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 576], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 577], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:25:10 UTC +00:00], ["name", "rule-8"], ["template_id", 578], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 579], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 580], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 581], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 580 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 581) LIMIT 1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["deliverable_id", 581], ["deliverable_type", "Rooler::Rule"], ["rule_id", 580], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 580]] 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", 581]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.9ms) Date: Thu, 27 Feb 2014 13:36:10 +0100 From: from@example.com To: test@email.com Message-ID: <530f313aa793a_32823fede1c35adc220ba@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 12:36:10.697654' WHERE "rooler_deliveries"."id" = 185  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 582], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 582]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 582 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 582) LIMIT 1 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", Thu, 27 Feb 2014 12:36:10 UTC +00:00], ["deliverable_id", 582], ["deliverable_type", "Rooler::Rule"], ["rule_id", 582], ["updated_at", Thu, 27 Feb 2014 12:36:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 582]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 583], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 583 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 583) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["deliverable_id", 583], ["deliverable_type", "Rooler::Rule"], ["rule_id", 583], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 583]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.4ms) Sent mail to test_name@to.com (25.7ms) Date: Thu, 27 Feb 2014 13:37:50 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f319ebfc4d_328f3fe30c435ad8184a8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 584], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 585], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 585]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 586], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 586]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 585 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 586) LIMIT 1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["deliverable_id", 586], ["deliverable_type", "Rooler::Rule"], ["rule_id", 585], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 585]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (586))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 587], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 587]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 587 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 587) LIMIT 1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["deliverable_id", 587], ["deliverable_type", "Rooler::Rule"], ["rule_id", 587], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 587]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (587))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 588], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 588 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 588) LIMIT 1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["deliverable_id", 588], ["deliverable_type", "Rooler::Rule"], ["rule_id", 588], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 588 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 588) LIMIT 1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 589], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 590], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 12:26:50 UTC +00:00], ["name", "rule-8"], ["template_id", 591], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 592], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 593], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 594], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 593 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 594) LIMIT 1 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", Thu, 27 Feb 2014 12:37:50 UTC +00:00], ["deliverable_id", 594], ["deliverable_type", "Rooler::Rule"], ["rule_id", 593], ["updated_at", Thu, 27 Feb 2014 12:37:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 593]] 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", 594]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.6ms) Date: Thu, 27 Feb 2014 13:37:51 +0100 From: from@example.com To: test@email.com Message-ID: <530f319f1606_328f3fe30c435ad8185e3@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 12:37:51.017696' WHERE "rooler_deliveries"."id" = 191 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 191]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-12"], ["created_at", Thu, 27 Feb 2014 12:37:51 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 12:37:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 12:37:51 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 595], ["updated_at", Thu, 27 Feb 2014 12:37:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 595]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 595 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 595) LIMIT 1 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", Thu, 27 Feb 2014 12:37:51 UTC +00:00], ["deliverable_id", 595], ["deliverable_type", "Rooler::Rule"], ["rule_id", 595], ["updated_at", Thu, 27 Feb 2014 12:37:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 595]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (22.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", Thu, 27 Feb 2014 14:27:27 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 14:27:27 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:27 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 596], ["updated_at", Thu, 27 Feb 2014 14:27:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 596 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 596) LIMIT 1 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", Thu, 27 Feb 2014 14:27:27 UTC +00:00], ["deliverable_id", 596], ["deliverable_type", "Rooler::Rule"], ["rule_id", 596], ["updated_at", Thu, 27 Feb 2014 14:27:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.0ms) 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", 596]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.9ms) Sent mail to test_name@to.com (25.2ms) Date: Thu, 27 Feb 2014 15:27:28 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f4b501e0dd_367d3fdb38435adc2538e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 597], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 597 [["rule_id", 597]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 598], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 598]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 599], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 599]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 599 [["rule_id", 598]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 598 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 599) LIMIT 1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["deliverable_id", 599], ["deliverable_type", "Rooler::Rule"], ["rule_id", 598], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 598]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (599))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 600], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 600]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 600 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 600) LIMIT 1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["deliverable_id", 600], ["deliverable_type", "Rooler::Rule"], ["rule_id", 600], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 600]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (600))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 601], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 601 [["rule_id", 601]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 601 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 601) LIMIT 1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["deliverable_id", 601], ["deliverable_type", "Rooler::Rule"], ["rule_id", 601], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 601 [["rule_id", 601]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 602], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 14:16:28 UTC +00:00], ["name", "rule-7"], ["template_id", 603], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-8"], ["template_id", 604], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 605], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 606], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 605 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 606) LIMIT 1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["deliverable_id", 606], ["deliverable_type", "Rooler::Rule"], ["rule_id", 605], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 605]] 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", 606]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (17.0ms) Date: Thu, 27 Feb 2014 15:27:28 +0100 From: from@example.com To: test@email.com Message-ID: <530f4b504fd26_367d3fdb38435adc254d4@Yonahs-MacBook-Pro.local.mail> Subject: subject-9 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-9 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 14:27:28.341450' WHERE "rooler_deliveries"."id" = 197 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 197]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 607], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 607]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 607 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 607) LIMIT 1 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", Thu, 27 Feb 2014 14:27:28 UTC +00:00], ["deliverable_id", 607], ["deliverable_type", "Rooler::Rule"], ["rule_id", 607], ["updated_at", Thu, 27 Feb 2014 14:27:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 607]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (20.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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 608], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 608 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 608) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["deliverable_id", 608], ["deliverable_type", "Rooler::Rule"], ["rule_id", 608], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 608]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.1ms) Sent mail to test_name@to.com (29.4ms) Date: Thu, 27 Feb 2014 16:01:53 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f5361a4000_38063fc380835ad074369@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 609], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 609 [["rule_id", 609]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 610], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 610]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 611], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 611]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 611 [["rule_id", 610]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 610 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 611) LIMIT 1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["deliverable_id", 611], ["deliverable_type", "Rooler::Rule"], ["rule_id", 610], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 610]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (611))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 612], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 612]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 612 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 612) LIMIT 1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["deliverable_id", 612], ["deliverable_type", "Rooler::Rule"], ["rule_id", 612], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 612]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (612))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 613], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 613 [["rule_id", 613]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 613 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 613) LIMIT 1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["deliverable_id", 613], ["deliverable_type", "Rooler::Rule"], ["rule_id", 613], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 613 [["rule_id", 613]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 614], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 14:50:53 UTC +00:00], ["name", "rule-7"], ["template_id", 615], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-8"], ["template_id", 616], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 617], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 618], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 617 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 618) LIMIT 1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["deliverable_id", 618], ["deliverable_type", "Rooler::Rule"], ["rule_id", 617], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 617]] 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", 618]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.9ms) Date: Thu, 27 Feb 2014 16:01:53 +0100 From: from@example.com To: test@email.com Message-ID: <530f5361d1fcd_38063fc380835ad07441b@Yonahs-MacBook-Pro.local.mail> Subject: subject-9 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-9 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 15:01:53.871408' WHERE "rooler_deliveries"."id" = 203 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 203]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 619], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 619]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 619 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 619) LIMIT 1 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", Thu, 27 Feb 2014 15:01:53 UTC +00:00], ["deliverable_id", 619], ["deliverable_type", "Rooler::Rule"], ["rule_id", 619], ["updated_at", Thu, 27 Feb 2014 15:01:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 619]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 620], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 620 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 620) LIMIT 1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["deliverable_id", 620], ["deliverable_type", "Rooler::Rule"], ["rule_id", 620], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 620]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.2ms) Sent mail to test_name@to.com (25.3ms) Date: Thu, 27 Feb 2014 16:02:18 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f537ab59a3_38103feca5035ad080682@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 621], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 621 [["rule_id", 621]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 622], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 622]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 623], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 623]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 623 [["rule_id", 622]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 622 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 623) LIMIT 1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["deliverable_id", 623], ["deliverable_type", "Rooler::Rule"], ["rule_id", 622], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 622]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (623))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 624], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 624]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 624 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 624) LIMIT 1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["deliverable_id", 624], ["deliverable_type", "Rooler::Rule"], ["rule_id", 624], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 624]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (624))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 625], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 625 [["rule_id", 625]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 625 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 625) LIMIT 1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["deliverable_id", 625], ["deliverable_type", "Rooler::Rule"], ["rule_id", 625], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 625 [["rule_id", 625]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 626], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 626 [["rule_id", 626]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 627], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 14:51:18 UTC +00:00], ["name", "rule-8"], ["template_id", 628], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 629], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 630], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 631], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 630 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 631) LIMIT 1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["deliverable_id", 631], ["deliverable_type", "Rooler::Rule"], ["rule_id", 630], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 630]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 631]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (18.9ms) Date: Thu, 27 Feb 2014 16:02:18 +0100 From: from@example.com To: test@email.com Message-ID: <530f537ae90b0_38103feca5035ad08075e@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 15:02:18.971025' WHERE "rooler_deliveries"."id" = 209 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 209]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 632], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 632]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 632 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 632) LIMIT 1 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", Thu, 27 Feb 2014 15:02:18 UTC +00:00], ["deliverable_id", 632], ["deliverable_type", "Rooler::Rule"], ["rule_id", 632], ["updated_at", Thu, 27 Feb 2014 15:02:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 632]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (8.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 633], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 633 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 633) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["deliverable_id", 633], ["deliverable_type", "Rooler::Rule"], ["rule_id", 633], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 633]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (73.3ms) Sent mail to test_name@to.com (30.0ms) Date: Thu, 27 Feb 2014 16:02:54 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <530f539ed6797_38173fe581035ad837353@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (1.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.8ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 634], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 634 [["rule_id", 634]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 635], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 635]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 636], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 636]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 636 [["rule_id", 635]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 635 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 636) LIMIT 1 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", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["deliverable_id", 636], ["deliverable_type", "Rooler::Rule"], ["rule_id", 635], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 635]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (636))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 637], ["updated_at", Thu, 27 Feb 2014 15:02:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 637]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 637 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 637) LIMIT 1 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", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["deliverable_id", 637], ["deliverable_type", "Rooler::Rule"], ["rule_id", 637], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 637]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (637))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-5"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 638], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 638 [["rule_id", 638]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 638 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 638) LIMIT 1 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", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["deliverable_id", 638], ["deliverable_type", "Rooler::Rule"], ["rule_id", 638], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 638 [["rule_id", 638]]  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 639], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 639 [["rule_id", 639]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 640], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 27 Feb 2014 14:51:55 UTC +00:00], ["name", "rule-8"], ["template_id", 641], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-9"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 642], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 643], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 644], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 643 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 644) LIMIT 1 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", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["deliverable_id", 644], ["deliverable_type", "Rooler::Rule"], ["rule_id", 643], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 643]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 644]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.4ms) Date: Thu, 27 Feb 2014 16:02:55 +0100 From: from@example.com To: test@email.com Message-ID: <530f539f21ae6_38173fe581035ad837446@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-02-27 15:02:55.150888' WHERE "rooler_deliveries"."id" = 215 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 215]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-12"], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 645], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 645]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 645 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 645) LIMIT 1 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", Thu, 27 Feb 2014 15:02:55 UTC +00:00], ["deliverable_id", 645], ["deliverable_type", "Rooler::Rule"], ["rule_id", 645], ["updated_at", Thu, 27 Feb 2014 15:02:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 645]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (31.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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "test_name"], ["template_id", 646], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 646 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 646) LIMIT 1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["deliverable_id", 646], ["deliverable_type", "Rooler::Rule"], ["rule_id", 646], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 646]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.9ms) Sent mail to test_name@to.com (37.7ms) Date: Thu, 13 Mar 2014 11:16:54 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53218596a5404_10f803fc375c35adc9673e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-1"], ["template_id", 647], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 647 [["rule_id", 647]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-2"], ["template_id", 648], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 648]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["name", "rule-3"], ["template_id", 649], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 649]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 649 [["rule_id", 648]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 648 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 649) LIMIT 1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["deliverable_id", 649], ["deliverable_type", "Rooler::Rule"], ["rule_id", 648], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 648]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (649))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-4"], ["template_id", 650], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 650]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 650 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 650) LIMIT 1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["deliverable_id", 650], ["deliverable_type", "Rooler::Rule"], ["rule_id", 650], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 650]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (650))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-5"], ["template_id", 651], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 651 [["rule_id", 651]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 651 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 651) LIMIT 1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["deliverable_id", 651], ["deliverable_type", "Rooler::Rule"], ["rule_id", 651], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 651 [["rule_id", 651]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-6"], ["template_id", 652], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 652 [["rule_id", 652]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-7"], ["template_id", 653], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "last_checked_at", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 10:05:54 UTC +00:00], ["name", "rule-8"], ["template_id", 654], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-9"], ["template_id", 655], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (8.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-10"], ["template_id", 656], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-11"], ["template_id", 657], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 656 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 657) LIMIT 1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["deliverable_id", 657], ["deliverable_type", "Rooler::Rule"], ["rule_id", 656], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 656]] 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", 657]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.4ms) Date: Thu, 13 Mar 2014 11:16:54 +0100 From: from@example.com To: test@email.com Message-ID: <53218596de7ad_10f803fc375c35adc96868@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 10:16:54.924131' WHERE "rooler_deliveries"."id" = 221 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 221]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["name", "rule-12"], ["template_id", 658], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 658]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 658 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 658) LIMIT 1 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", Thu, 13 Mar 2014 10:16:54 UTC +00:00], ["deliverable_id", 658], ["deliverable_type", "Rooler::Rule"], ["rule_id", 658], ["updated_at", Thu, 13 Mar 2014 10:16:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 658]]  (0.2ms) ROLLBACK  (331.5ms) DROP DATABASE IF EXISTS "dummy_test"  (768.1ms) CREATE DATABASE "dummy_test" ENCODING = 'utf8' SQL (3.7ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (9.0ms) CREATE TABLE "rooler_deliveries" ("id" serial primary key, "deliverable_type" character varying(255), "deliverable_id" integer, "rule_id" integer, "delivered_at" timestamp, "created_at" timestamp, "updated_at" timestamp)  (8.0ms) CREATE TABLE "rooler_rules" ("id" serial primary key, "name" character varying(255), "template_id" integer, "check_frequency" integer, "last_checked_at" timestamp, "klass_name" character varying(255), "klass_finder_method" character varying(255), "instance_checker_method" character varying(255), "created_at" timestamp, "updated_at" timestamp, "method_params" character varying(255))   (7.6ms) CREATE TABLE "rooler_templates" ("id" serial primary key, "name" character varying(255), "to" character varying(255), "cc" character varying(255), "subject" character varying(255), "body" text, "created_at" timestamp, "updated_at" timestamp)  (1.4ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)   (2.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.6ms) SELECT version FROM "schema_migrations"  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140313103833')  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140226113304')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140226113305')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140226120455') ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 1], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 1) LIMIT 1 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", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["deliverable_id", 1], ["deliverable_type", "Rooler::Rule"], ["rule_id", 1], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 1]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (53.8ms) Sent mail to test_name@to.com (24.8ms) Date: Thu, 13 Mar 2014 12:10:55 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5321923fbdd60_112353ff805c35ae04183b@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 2], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 2 [["rule_id", 2]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 3], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 3]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 4], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 4]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 5], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 5 [["rule_id", 5]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 6], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 10:59:55 UTC +00:00], ["method_params", nil], ["name", "rule-6"], ["template_id", 7], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 8], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 9], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 10], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 9 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 10) LIMIT 1 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", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["deliverable_id", 10], ["deliverable_type", "Rooler::Rule"], ["rule_id", 9], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.4ms) 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", 9]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 10]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (13.8ms) Date: Thu, 13 Mar 2014 12:10:55 +0100 From: from@example.com To: test@email.com Message-ID: <5321923fe6b32_112353ff805c35ae0419fe@Yonahs-MacBook-Pro.local.mail> Subject: subject-8 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-8 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:10:55.956434' WHERE "rooler_deliveries"."id" = 2 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 2]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 11], ["updated_at", Thu, 13 Mar 2014 11:10:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 11]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 12], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 12 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 12) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["deliverable_id", 12], ["deliverable_type", "Rooler::Rule"], ["rule_id", 12], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 12]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.8ms) Sent mail to test_name@to.com (22.7ms) Date: Thu, 13 Mar 2014 12:32:59 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5321976bc1031_113203fc005835ae0302ac@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 13], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 13 [["rule_id", 13]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 14], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 14]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.4ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 15], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 15]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 15 [["rule_id", 14]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 14 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 15) LIMIT 1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["deliverable_id", 15], ["deliverable_type", "Rooler::Rule"], ["rule_id", 14], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 14]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (15))  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 16], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 16]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 16 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 16) LIMIT 1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["deliverable_id", 16], ["deliverable_type", "Rooler::Rule"], ["rule_id", 16], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 16]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (16))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 17], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 17 [["rule_id", 17]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 17 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 17) LIMIT 1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["deliverable_id", 17], ["deliverable_type", "Rooler::Rule"], ["rule_id", 17], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 17 [["rule_id", 17]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 18], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 18 [["rule_id", 18]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 19], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 11:21:59 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 20], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 21], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 22], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 23], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 22 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 23) LIMIT 1 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", Thu, 13 Mar 2014 11:32:59 UTC +00:00], ["deliverable_id", 23], ["deliverable_type", "Rooler::Rule"], ["rule_id", 22], ["updated_at", Thu, 13 Mar 2014 11:32:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 22]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 23]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.7ms) Date: Thu, 13 Mar 2014 12:33:00 +0100 From: from@example.com To: test@email.com Message-ID: <5321976ca07_113203fc005835ae030322@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:33:00.013549' WHERE "rooler_deliveries"."id" = 7 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 7]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 13 Mar 2014 11:33:00 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:33:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 11:33:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 24], ["updated_at", Thu, 13 Mar 2014 11:33:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 24]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 24 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 24) LIMIT 1 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", Thu, 13 Mar 2014 11:33:00 UTC +00:00], ["deliverable_id", 24], ["deliverable_type", "Rooler::Rule"], ["rule_id", 24], ["updated_at", Thu, 13 Mar 2014 11:33:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 24]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 13 Mar 2014 11:36:33 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 11:36:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:33 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 25], ["updated_at", Thu, 13 Mar 2014 11:36:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 25 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 25) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:33 UTC +00:00], ["deliverable_id", 25], ["deliverable_type", "Rooler::Rule"], ["rule_id", 25], ["updated_at", Thu, 13 Mar 2014 11:36:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 25]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.6ms) Sent mail to test_name@to.com (23.2ms) Date: Thu, 13 Mar 2014 12:36:34 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532198428bf3_113503fe2b8835ad817376@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 26], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 26 [["rule_id", 26]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 27], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 27]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 28], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 28]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 28 [["rule_id", 27]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 27 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 28) LIMIT 1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["deliverable_id", 28], ["deliverable_type", "Rooler::Rule"], ["rule_id", 27], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 27]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (28))  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 29], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 30], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 29]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 31], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 31]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 31 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 31) LIMIT 1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["deliverable_id", 31], ["deliverable_type", "Rooler::Rule"], ["rule_id", 31], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 31]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (31))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 32], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 32 [["rule_id", 32]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 32 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 32) LIMIT 1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["deliverable_id", 32], ["deliverable_type", "Rooler::Rule"], ["rule_id", 32], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 32 [["rule_id", 32]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 33], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 33 [["rule_id", 33]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 34], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 11:25:34 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 35], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 36], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 37], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 38], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 37 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 38) LIMIT 1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["deliverable_id", 38], ["deliverable_type", "Rooler::Rule"], ["rule_id", 37], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 37]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 38]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.7ms) Date: Thu, 13 Mar 2014 12:36:34 +0100 From: from@example.com To: test@email.com Message-ID: <532198424054d_113503fe2b8835ad817419@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:36:34.275495' WHERE "rooler_deliveries"."id" = 13 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 13]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 39], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 39]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 39 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 39) LIMIT 1 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", Thu, 13 Mar 2014 11:36:34 UTC +00:00], ["deliverable_id", 39], ["deliverable_type", "Rooler::Rule"], ["rule_id", 39], ["updated_at", Thu, 13 Mar 2014 11:36:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 39]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (10.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 13 Mar 2014 11:36:52 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 11:36:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 40], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 40 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 40) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["deliverable_id", 40], ["deliverable_type", "Rooler::Rule"], ["rule_id", 40], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 40]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.0ms) Sent mail to test_name@to.com (23.5ms) Date: Thu, 13 Mar 2014 12:36:53 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53219855332c6_113583fd200835ad864574@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 41], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 41 [["rule_id", 41]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 42], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 42]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 43], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 43]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 43 [["rule_id", 42]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 42 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 43) LIMIT 1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["deliverable_id", 43], ["deliverable_type", "Rooler::Rule"], ["rule_id", 42], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 42]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (43))  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 2\n...\n"], ["name", "rule-4"], ["template_id", 44], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 45], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 44]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 2  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-6"], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 46], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 46]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 46 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 46) LIMIT 1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["deliverable_id", 46], ["deliverable_type", "Rooler::Rule"], ["rule_id", 46], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 46]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (46))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 47], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 47 [["rule_id", 47]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 47 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 47) LIMIT 1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["deliverable_id", 47], ["deliverable_type", "Rooler::Rule"], ["rule_id", 47], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 47 [["rule_id", 47]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 48], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 48 [["rule_id", 48]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 49], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 11:25:53 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 50], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 51], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 52], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 53], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 52 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 53) LIMIT 1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["deliverable_id", 53], ["deliverable_type", "Rooler::Rule"], ["rule_id", 52], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 52]] 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", 53]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.6ms) Date: Thu, 13 Mar 2014 12:36:53 +0100 From: from@example.com To: test@email.com Message-ID: <532198557e120_113583fd200835ad8646ad@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:36:53.528148' WHERE "rooler_deliveries"."id" = 19 Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 19]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 54], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 54]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 54 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 54) LIMIT 1 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", Thu, 13 Mar 2014 11:36:53 UTC +00:00], ["deliverable_id", 54], ["deliverable_type", "Rooler::Rule"], ["rule_id", 54], ["updated_at", Thu, 13 Mar 2014 11:36:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 54]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 55], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 55 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 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", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Rooler::Rule"], ["rule_id", 55], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 55]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.3ms) Sent mail to test_name@to.com (30.1ms) Date: Thu, 13 Mar 2014 12:37:08 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53219864de04c_113613fec75c35ae0275e8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 56], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 56 [["rule_id", 56]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 57], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 57]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 58], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 58]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 58 [["rule_id", 57]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 57 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 58) LIMIT 1 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", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["deliverable_id", 58], ["deliverable_type", "Rooler::Rule"], ["rule_id", 57], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 57]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (58))  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:37:08 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 59], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 60], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 59]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 61], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 61]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 61 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 61) LIMIT 1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["deliverable_id", 61], ["deliverable_type", "Rooler::Rule"], ["rule_id", 61], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 61]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (61))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 62], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 62 [["rule_id", 62]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 62 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 62) LIMIT 1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["deliverable_id", 62], ["deliverable_type", "Rooler::Rule"], ["rule_id", 62], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 62 [["rule_id", 62]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 63], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 63 [["rule_id", 63]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 64], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 11:26:09 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 65], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 66], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 67], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 68], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 67 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 68) LIMIT 1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["deliverable_id", 68], ["deliverable_type", "Rooler::Rule"], ["rule_id", 67], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 67]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 68]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (15.6ms) Date: Thu, 13 Mar 2014 12:37:09 +0100 From: from@example.com To: test@email.com Message-ID: <5321986527009_113613fec75c35ae0276e4@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 11:37:09.173868' WHERE "rooler_deliveries"."id" = 25 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 25]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 69], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 69]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 69 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 69) LIMIT 1 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", Thu, 13 Mar 2014 11:37:09 UTC +00:00], ["deliverable_id", 69], ["deliverable_type", "Rooler::Rule"], ["rule_id", 69], ["updated_at", Thu, 13 Mar 2014 11:37:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 69]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 70], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 70 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 70) LIMIT 1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["deliverable_id", 70], ["deliverable_type", "Rooler::Rule"], ["rule_id", 70], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 70]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.5ms) Sent mail to test_name@to.com (25.2ms) Date: Thu, 13 Mar 2014 13:01:55 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53219e338dbc6_114e53fd61e035adc89278@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 71], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 71 [["rule_id", 71]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 72], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 72]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 73], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 73]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 73 [["rule_id", 72]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 72 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 73) LIMIT 1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["deliverable_id", 73], ["deliverable_type", "Rooler::Rule"], ["rule_id", 72], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 72]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (73))  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 74], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 75], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 74]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t') LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 76], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 76]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 76 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 76) LIMIT 1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["deliverable_id", 76], ["deliverable_type", "Rooler::Rule"], ["rule_id", 76], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 76]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (id not in (76))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 77], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 77 [["rule_id", 77]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 77 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["deliverable_id", 77], ["deliverable_type", "Rooler::Rule"], ["rule_id", 77], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 77 [["rule_id", 77]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 78], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 78 [["rule_id", 78]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 79], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Thu, 13 Mar 2014 11:50:55 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 80], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 81], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 82], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 83], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 82 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 83) LIMIT 1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["deliverable_id", 83], ["deliverable_type", "Rooler::Rule"], ["rule_id", 82], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 82]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 83]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.3ms) Date: Thu, 13 Mar 2014 13:01:55 +0100 From: from@example.com To: test@email.com Message-ID: <53219e33c7c29_114e53fd61e035adc89366@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-13 12:01:55.829779' WHERE "rooler_deliveries"."id" = 31 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 31]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 84], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' [["rule_id", 84]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 84 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 84) LIMIT 1 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", Thu, 13 Mar 2014 12:01:55 UTC +00:00], ["deliverable_id", 84], ["deliverable_type", "Rooler::Rule"], ["rule_id", 84], ["updated_at", Thu, 13 Mar 2014 12:01:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 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", 84]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (26.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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 85], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 85 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 85) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["deliverable_id", 85], ["deliverable_type", "Rooler::Rule"], ["rule_id", 85], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 85]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.2ms) Sent mail to test_name@to.com (38.8ms) Date: Mon, 17 Mar 2014 11:34:38 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326cfbe5ebc9_20363fe7da035adc185b4@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 86], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 86 [["rule_id", 86]]  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable" = 'a string object' [["rule_id", 86]] PG::UndefinedColumn: ERROR: column rooler_deliveries.deliverable does not exist LINE 1: ...es" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_de... ^ : SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable" = 'a string object'  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 87], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 87]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-3"], ["template_id", 88], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 89], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 88]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 90], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 91], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 91 [["rule_id", 91]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 91 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Rooler::Rule"], ["rule_id", 91], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 91 [["rule_id", 91]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 92], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 92 [["rule_id", 92]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 93], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:23:38 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 94], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 95], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 96], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 97], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 97) LIMIT 1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["deliverable_id", 97], ["deliverable_type", "Rooler::Rule"], ["rule_id", 96], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 96]] 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", 97]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (15.6ms) Date: Mon, 17 Mar 2014 11:34:38 +0100 From: from@example.com To: test@email.com Message-ID: <5326cfbe9858e_20363fe7da035adc18680@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:34:38.638150' WHERE "rooler_deliveries"."id" = 35 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 35]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 98], ["updated_at", Mon, 17 Mar 2014 10:34:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 99], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 99 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 99) LIMIT 1 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", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["deliverable_id", 99], ["deliverable_type", "Rooler::Rule"], ["rule_id", 99], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 99]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.2ms) Sent mail to test_name@to.com (28.6ms) Date: Mon, 17 Mar 2014 11:36:22 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d026e624a_204d3fecac835ad051673@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 100], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 100 [["rule_id", 100]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 101], ["updated_at", Mon, 17 Mar 2014 10:36:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 101]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-3"], ["template_id", 102], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 103], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 102]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 104], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 105], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 105 [["rule_id", 105]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 105 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 105) LIMIT 1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["deliverable_id", 105], ["deliverable_type", "Rooler::Rule"], ["rule_id", 105], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 105 [["rule_id", 105]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 106], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 106 [["rule_id", 106]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 107], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:25:23 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 108], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 109], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 110], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 111], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 110 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 111) LIMIT 1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["deliverable_id", 111], ["deliverable_type", "Rooler::Rule"], ["rule_id", 110], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 110]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 111]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (19.4ms) Date: Mon, 17 Mar 2014 11:36:23 +0100 From: from@example.com To: test@email.com Message-ID: <5326d02723ba8_204d3fecac835ad051786@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:36:23.161917' WHERE "rooler_deliveries"."id" = 38 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 38]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 112], ["updated_at", Mon, 17 Mar 2014 10:36:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 113], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 113 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 113) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["deliverable_id", 113], ["deliverable_type", "Rooler::Rule"], ["rule_id", 113], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 113]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (40.7ms) Sent mail to test_name@to.com (23.2ms) Date: Mon, 17 Mar 2014 11:42:46 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d1a6e09a3_20a23fe689c35adc528b3@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 114], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 114 [["rule_id", 114]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 115], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 115]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-3"], ["template_id", 116], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 117], ["updated_at", Mon, 17 Mar 2014 10:42:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 118], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 118]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 119], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 119 [["rule_id", 119]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 119 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 119) LIMIT 1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["deliverable_id", 119], ["deliverable_type", "Rooler::Rule"], ["rule_id", 119], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 119 [["rule_id", 119]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 120], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 120 [["rule_id", 120]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 121], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:31:47 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 122], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 123], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 124], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 125], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 124 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 125) LIMIT 1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["deliverable_id", 125], ["deliverable_type", "Rooler::Rule"], ["rule_id", 124], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 124]] 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", 125]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.5ms) Date: Mon, 17 Mar 2014 11:42:47 +0100 From: from@example.com To: test@email.com Message-ID: <5326d1a71d70a_20a23fe689c35adc529f3@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:42:47.131493' WHERE "rooler_deliveries"."id" = 41 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 41]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 126], ["updated_at", Mon, 17 Mar 2014 10:42:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 127], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 127 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Rooler::Rule"], ["rule_id", 127], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 127]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.5ms) Sent mail to test_name@to.com (23.4ms) Date: Mon, 17 Mar 2014 11:43:39 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d1dbd4f1c_20af3fcd15435ae0252b8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 128], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 128 [["rule_id", 128]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 129], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 129]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-3"], ["template_id", 130], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 131], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 130]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 132], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 132]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 133], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 133 [["rule_id", 133]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 133 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 133) LIMIT 1 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", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["deliverable_id", 133], ["deliverable_type", "Rooler::Rule"], ["rule_id", 133], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 133 [["rule_id", 133]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 134], ["updated_at", Mon, 17 Mar 2014 10:43:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 134 [["rule_id", 134]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 135], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:32:40 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 136], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 137], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 138], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 139], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 138 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 139) LIMIT 1 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", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["deliverable_id", 139], ["deliverable_type", "Rooler::Rule"], ["rule_id", 138], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.0ms) 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", 138]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 139]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (16.5ms) Date: Mon, 17 Mar 2014 11:43:40 +0100 From: from@example.com To: test@email.com Message-ID: <5326d1dc14555_20af3fcd15435ae0253d1@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:43:40.096255' WHERE "rooler_deliveries"."id" = 44 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 44]]  (0.5ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 140], ["updated_at", Mon, 17 Mar 2014 10:43:40 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 140]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (13.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 10:44:27 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 10:44:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:27 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 141], ["updated_at", Mon, 17 Mar 2014 10:44:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 141 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 141) LIMIT 1 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", Mon, 17 Mar 2014 10:44:27 UTC +00:00], ["deliverable_id", 141], ["deliverable_type", "Rooler::Rule"], ["rule_id", 141], ["updated_at", Mon, 17 Mar 2014 10:44:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 141]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.6ms) Sent mail to test_name@to.com (23.2ms) Date: Mon, 17 Mar 2014 11:44:27 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d20bf101b_20bc3fc8d4c35adc567da@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 142], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 142 [["rule_id", 142]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 143], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-3"], ["template_id", 144], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 145], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 144]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 146], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 146]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 147], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 147 [["rule_id", 147]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 147 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 147) LIMIT 1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["deliverable_id", 147], ["deliverable_type", "Rooler::Rule"], ["rule_id", 147], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 147 [["rule_id", 147]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 148], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 148 [["rule_id", 148]]  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 149], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:33:28 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 150], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 151], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 152], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 153], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 152 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 153) LIMIT 1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["deliverable_id", 153], ["deliverable_type", "Rooler::Rule"], ["rule_id", 152], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 152]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 153]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.3ms) Date: Mon, 17 Mar 2014 11:44:28 +0100 From: from@example.com To: test@email.com Message-ID: <5326d20c30e29_20bc3fc8d4c35adc56877@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:44:28.211870' WHERE "rooler_deliveries"."id" = 47 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 47]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 154], ["updated_at", Mon, 17 Mar 2014 10:44:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 154]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 10:51:39 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 10:51:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:39 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 155], ["updated_at", Mon, 17 Mar 2014 10:51:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 155 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 155) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:39 UTC +00:00], ["deliverable_id", 155], ["deliverable_type", "Rooler::Rule"], ["rule_id", 155], ["updated_at", Mon, 17 Mar 2014 10:51:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 155]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.3ms) Sent mail to test_name@to.com (23.4ms) Date: Mon, 17 Mar 2014 11:51:40 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d3bc16e83_210a3fe958c35ad8778c2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 156], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 156 [["rule_id", 156]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 157], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 158], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 158 [["rule_id", 157]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 157 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Rooler::Rule"], ["rule_id", 157], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 159], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 160], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 161], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 161 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 161) LIMIT 1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["deliverable_id", 161], ["deliverable_type", "Rooler::Rule"], ["rule_id", 161], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 161 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 161) LIMIT 1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 162], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 162 [["rule_id", 162]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 162 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 162) LIMIT 1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["deliverable_id", 162], ["deliverable_type", "Rooler::Rule"], ["rule_id", 162], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 162 [["rule_id", 162]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 163], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 163 [["rule_id", 163]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 164], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:40:40 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 165], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 166], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 167], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 168], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 167 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 168) LIMIT 1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["deliverable_id", 168], ["deliverable_type", "Rooler::Rule"], ["rule_id", 167], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 167]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 168]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (17.3ms) Date: Mon, 17 Mar 2014 11:51:40 +0100 From: from@example.com To: test@email.com Message-ID: <5326d3bc6e662_210a3fe958c35ad877957@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 10:51:40.467669' WHERE "rooler_deliveries"."id" = 52 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 52]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 169], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 169 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 169) LIMIT 1 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", Mon, 17 Mar 2014 10:51:40 UTC +00:00], ["deliverable_id", 169], ["deliverable_type", "Rooler::Rule"], ["rule_id", 169], ["updated_at", Mon, 17 Mar 2014 10:51:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 169]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (11.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 170], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 170 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 170) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["deliverable_id", 170], ["deliverable_type", "Rooler::Rule"], ["rule_id", 170], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 170]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (50.5ms) Sent mail to test_name@to.com (23.6ms) Date: Mon, 17 Mar 2014 12:03:46 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d692877ed_219f3fd82c835ad875637@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 171], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 171 [["rule_id", 171]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 172], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 173], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 173 [["rule_id", 172]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 172 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Rooler::Rule"], ["rule_id", 172], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 174], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 175], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 176], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 176 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 176) LIMIT 1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["deliverable_id", 176], ["deliverable_type", "Rooler::Rule"], ["rule_id", 176], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 176 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 176) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 177], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 177 [["rule_id", 177]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 177 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 177) LIMIT 1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["deliverable_id", 177], ["deliverable_type", "Rooler::Rule"], ["rule_id", 177], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 177 [["rule_id", 177]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 178], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 178 [["rule_id", 178]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 179], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:52:46 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 180], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 181], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 182], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 183], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 182 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Rooler::Rule"], ["rule_id", 182], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 182]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 183]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.4ms) Date: Mon, 17 Mar 2014 12:03:46 +0100 From: from@example.com To: test@email.com Message-ID: <5326d692c91ab_219f3fd82c835ad875752@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:03:46.836303' WHERE "rooler_deliveries"."id" = 58 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 58]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 184], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 184 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 184) LIMIT 1 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", Mon, 17 Mar 2014 11:03:46 UTC +00:00], ["deliverable_id", 184], ["deliverable_type", "Rooler::Rule"], ["rule_id", 184], ["updated_at", Mon, 17 Mar 2014 11:03:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 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", 184]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (8.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 11:04:23 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 11:04:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:23 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 185], ["updated_at", Mon, 17 Mar 2014 11:04:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 185 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1 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", Mon, 17 Mar 2014 11:04:23 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Rooler::Rule"], ["rule_id", 185], ["updated_at", Mon, 17 Mar 2014 11:04:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 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", 185]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.6ms) Sent mail to test_name@to.com (27.0ms) Date: Mon, 17 Mar 2014 12:04:24 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d6b817c33_21ad3fd439435ad81894a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 186], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 186 [["rule_id", 186]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 187], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 188], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 188 [["rule_id", 187]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 187 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 188) LIMIT 1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["deliverable_id", 188], ["deliverable_type", "Rooler::Rule"], ["rule_id", 187], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 189], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 190], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 191], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 191 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 191) LIMIT 1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["deliverable_id", 191], ["deliverable_type", "Rooler::Rule"], ["rule_id", 191], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 191 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 191) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 192], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 192 [["rule_id", 192]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 192 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 192) LIMIT 1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["deliverable_id", 192], ["deliverable_type", "Rooler::Rule"], ["rule_id", 192], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 192 [["rule_id", 192]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 193], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 193 [["rule_id", 193]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 194], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:53:24 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 195], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 196], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 197], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 198], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 197 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 198) LIMIT 1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["deliverable_id", 198], ["deliverable_type", "Rooler::Rule"], ["rule_id", 197], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 197]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 198]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (19.7ms) Date: Mon, 17 Mar 2014 12:04:24 +0100 From: from@example.com To: test@email.com Message-ID: <5326d6b85bfe8_21ad3fd439435ad8190e2@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:04:24.394783' WHERE "rooler_deliveries"."id" = 64 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 64]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 199], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 199 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1 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", Mon, 17 Mar 2014 11:04:24 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Rooler::Rule"], ["rule_id", 199], ["updated_at", Mon, 17 Mar 2014 11:04:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 199]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (10.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 200], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 200 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 200) LIMIT 1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["deliverable_id", 200], ["deliverable_type", "Rooler::Rule"], ["rule_id", 200], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 200]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.5ms) Sent mail to test_name@to.com (24.8ms) Date: Mon, 17 Mar 2014 12:10:56 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d84084742_22173ffe1c835ae0727d@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 201], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 201 [["rule_id", 201]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 202], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 203], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params ---------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 204], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 205], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 206], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["deliverable_id", 206], ["deliverable_type", "Rooler::Rule"], ["rule_id", 206], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 207], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 207 [["rule_id", 207]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 207 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 207) LIMIT 1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["deliverable_id", 207], ["deliverable_type", "Rooler::Rule"], ["rule_id", 207], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 207 [["rule_id", 207]]  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 208], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 208 [["rule_id", 208]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 209], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 10:59:56 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 210], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 211], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 212], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 213], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 212 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 213) LIMIT 1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["deliverable_id", 213], ["deliverable_type", "Rooler::Rule"], ["rule_id", 212], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 212]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 213]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.0ms) Date: Mon, 17 Mar 2014 12:10:56 +0100 From: from@example.com To: test@email.com Message-ID: <5326d840bfa63_22173ffe1c835ae0734c@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:10:56.797320' WHERE "rooler_deliveries"."id" = 69 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 69]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 214], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 214 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 214) LIMIT 1 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", Mon, 17 Mar 2014 11:10:56 UTC +00:00], ["deliverable_id", 214], ["deliverable_type", "Rooler::Rule"], ["rule_id", 214], ["updated_at", Mon, 17 Mar 2014 11:10:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 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", 214]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 215], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 215 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 215) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["deliverable_id", 215], ["deliverable_type", "Rooler::Rule"], ["rule_id", 215], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.4ms) 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", 215]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.3ms) Sent mail to test_name@to.com (25.7ms) Date: Mon, 17 Mar 2014 12:14:00 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d8f84c0cf_22453fc649035ad0873c7@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 216], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 216 [["rule_id", 216]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 217], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 218], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 219], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 219 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 219) LIMIT 1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["deliverable_id", 219], ["deliverable_type", "Rooler::Rule"], ["rule_id", 219], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 219 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 219) LIMIT 1  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 220], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 220 [["rule_id", 220]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 220 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 220) LIMIT 1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["deliverable_id", 220], ["deliverable_type", "Rooler::Rule"], ["rule_id", 220], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 220 [["rule_id", 220]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 221], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 221 [["rule_id", 221]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params -------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-7"], ["template_id", 222], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 223], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 224], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 11:03:00 UTC +00:00], ["method_params", nil], ["name", "rule-10"], ["template_id", 225], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 226], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 227], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 228], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 227 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 228) LIMIT 1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["deliverable_id", 228], ["deliverable_type", "Rooler::Rule"], ["rule_id", 227], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 227]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 228]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.1ms) Date: Mon, 17 Mar 2014 12:14:00 +0100 From: from@example.com To: test@email.com Message-ID: <5326d8f885367_22453fc649035ad0874c8@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:14:00.557213' WHERE "rooler_deliveries"."id" = 74 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 74]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 229], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 229 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 229) LIMIT 1 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", Mon, 17 Mar 2014 11:14:00 UTC +00:00], ["deliverable_id", 229], ["deliverable_type", "Rooler::Rule"], ["rule_id", 229], ["updated_at", Mon, 17 Mar 2014 11:14:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 229]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 230], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 230 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 230) LIMIT 1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["deliverable_id", 230], ["deliverable_type", "Rooler::Rule"], ["rule_id", 230], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 230]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.4ms) Sent mail to test_name@to.com (23.8ms) Date: Mon, 17 Mar 2014 12:14:47 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326d927c3b35_22523ff0c4c35ad85161a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 231], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 231 [["rule_id", 231]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 232], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 233], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 234], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 234 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 234) LIMIT 1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["deliverable_id", 234], ["deliverable_type", "Rooler::Rule"], ["rule_id", 234], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 234 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 234) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 235], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235 [["rule_id", 235]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 235 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Rooler::Rule"], ["rule_id", 235], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235 [["rule_id", 235]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 236], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 236 [["rule_id", 236]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params -------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-7"], ["template_id", 237], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Foobar"], ["method_params", nil], ["name", "rule-8"], ["template_id", 238], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "where"], ["klass_name", "Rooler::Rule"], ["method_params", "---\n:klass_name: Rooler::Rule\n"], ["name", "rule-9"], ["template_id", 239], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 240], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 11:03:47 UTC +00:00], ["method_params", nil], ["name", "rule-11"], ["template_id", 241], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 242], ["updated_at", Mon, 17 Mar 2014 11:14:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 243], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 244], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 243 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 244) LIMIT 1 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", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["deliverable_id", 244], ["deliverable_type", "Rooler::Rule"], ["rule_id", 243], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 243]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 244]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.9ms) Date: Mon, 17 Mar 2014 12:14:48 +0100 From: from@example.com To: test@email.com Message-ID: <5326d928a7f2_22523ff0c4c35ad8517e1@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:14:48.054343' WHERE "rooler_deliveries"."id" = 79 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 79]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-15"], ["template_id", 245], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 245 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 245) LIMIT 1 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", Mon, 17 Mar 2014 11:14:48 UTC +00:00], ["deliverable_id", 245], ["deliverable_type", "Rooler::Rule"], ["rule_id", 245], ["updated_at", Mon, 17 Mar 2014 11:14:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 245]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 11:26:56 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 11:26:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:56 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 246], ["updated_at", Mon, 17 Mar 2014 11:26:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 246 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 246) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:56 UTC +00:00], ["deliverable_id", 246], ["deliverable_type", "Rooler::Rule"], ["rule_id", 246], ["updated_at", Mon, 17 Mar 2014 11:26:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 246]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.5ms) Sent mail to test_name@to.com (25.3ms) Date: Mon, 17 Mar 2014 12:26:56 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5326dc00f30dd_22e33fdde4435ad859951@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 247], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 247 [["rule_id", 247]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 248], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 249], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 250], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 250 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 250) LIMIT 1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["deliverable_id", 250], ["deliverable_type", "Rooler::Rule"], ["rule_id", 250], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 250 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 250) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 251], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 251 [["rule_id", 251]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 251 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 251) LIMIT 1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["deliverable_id", 251], ["deliverable_type", "Rooler::Rule"], ["rule_id", 251], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 251 [["rule_id", 251]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-6"], ["template_id", 252], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 252 [["rule_id", 252]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params -------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-7"], ["template_id", 253], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Foobar"], ["method_params", nil], ["name", "rule-8"], ["template_id", 254], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "where"], ["klass_name", "Rooler::Rule"], ["method_params", "---\n:klass_name: Rooler::Rule\n"], ["name", "rule-9"], ["template_id", 255], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 256], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "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, $10) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["last_checked_at", Mon, 17 Mar 2014 11:15:57 UTC +00:00], ["method_params", nil], ["name", "rule-11"], ["template_id", 257], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 258], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now()))  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-13"], ["template_id", 259], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-14"], ["template_id", 260], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 259 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 260) LIMIT 1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["deliverable_id", 260], ["deliverable_type", "Rooler::Rule"], ["rule_id", 259], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 259]] 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", 260]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.9ms) Date: Mon, 17 Mar 2014 12:26:57 +0100 From: from@example.com To: test@email.com Message-ID: <5326dc013e367_22e33fdde4435ad8600f@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 11:26:57.267193' WHERE "rooler_deliveries"."id" = 84 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 84]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-15"], ["template_id", 261], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (check_frequency IS NOT NULL AND (last_checked_at IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 261 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 261) LIMIT 1 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", Mon, 17 Mar 2014 11:26:57 UTC +00:00], ["deliverable_id", 261], ["deliverable_type", "Rooler::Rule"], ["rule_id", 261], ["updated_at", Mon, 17 Mar 2014 11:26:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 261]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (25.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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 262], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 262 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 262) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["deliverable_id", 262], ["deliverable_type", "Rooler::Rule"], ["rule_id", 262], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 262]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.5ms) Sent mail to test_name@to.com (46.1ms) Date: Mon, 17 Mar 2014 17:48:30 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5327275e674d0_34643fcb3d835ad41329c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check()_method_runs_the_instance_method_against_the_provided_object._returns_error_if_they_are_not_the_same_class ----------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "nil?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 263], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 264], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 265], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-4"], ["template_id", 266], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 266]] Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 266 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 266) LIMIT 1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["deliverable_id", 266], ["deliverable_type", "Rooler::Rule"], ["rule_id", 266], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:48:30.530306' WHERE "rooler_rules"."id" = 266  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 266 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 266) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:48:30.678742' WHERE "rooler_rules"."id" = 266  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_creates_deliveries_ONCE_for_specific_object_if_instance_method_returns_true --------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-5"], ["template_id", 267], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_unprocessed_objects_of_rules_class_using_klass_method_with_params -------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-6"], ["template_id", 268], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Foobar"], ["method_params", nil], ["name", "rule-7"], ["template_id", 269], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "where"], ["klass_name", "Rooler::Rule"], ["method_params", "---\n:klass_name: Rooler::Rule\n"], ["name", "rule-8"], ["template_id", 270], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 271], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-10"], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 272], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 273], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 272 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 273) LIMIT 1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["deliverable_id", 273], ["deliverable_type", "Rooler::Rule"], ["rule_id", 272], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 272]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 273]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.7ms) Date: Mon, 17 Mar 2014 17:48:30 +0100 From: from@example.com To: test@email.com Message-ID: <5327275ec97bb_34643fcb3d835ad413335@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 16:48:30.837128' WHERE "rooler_deliveries"."id" = 88 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 88]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-12"], ["template_id", 274], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 274]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 274 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 274) LIMIT 1 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", Mon, 17 Mar 2014 16:48:30 UTC +00:00], ["deliverable_id", 274], ["deliverable_type", "Rooler::Rule"], ["rule_id", 274], ["updated_at", Mon, 17 Mar 2014 16:48:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:48:30.864270' WHERE "rooler_rules"."id" = 274  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 274]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 16:58:53 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 16:58:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:53 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "test_name"], ["template_id", 275], ["updated_at", Mon, 17 Mar 2014 16:58:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 275 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 275) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["deliverable_id", 275], ["deliverable_type", "Rooler::Rule"], ["rule_id", 275], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 275]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.3ms) Sent mail to test_name@to.com (23.0ms) Date: Mon, 17 Mar 2014 17:58:54 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532729ce2a24c_34ee3fe519835ad46447a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_unprocessed_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-1"], ["template_id", 276], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "last"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-2"], ["template_id", 277], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" ORDER BY "rooler_rules"."id" DESC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-3"], ["template_id", 278], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 278) LIMIT 1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["deliverable_id", 278], ["deliverable_type", "Rooler::Rule"], ["rule_id", 278], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:58:54.247229' WHERE "rooler_rules"."id" = 278  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 278) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:58:54.267223' WHERE "rooler_rules"."id" = 278  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "take"], ["klass_name", "Rooler::Rule"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 279], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Foobar"], ["method_params", nil], ["name", "rule-5"], ["template_id", 280], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "where"], ["klass_name", "Rooler::Rule"], ["method_params", "---\n:klass_name: Rooler::Rule\n"], ["name", "rule-6"], ["template_id", 281], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."klass_name" = 'Rooler::Rule'  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays -------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "to_a"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-7"], ["template_id", 282], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-8"], ["template_id", 283], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-9"], ["template_id", 284], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-10"], ["template_id", 285], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 284 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 285) LIMIT 1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["deliverable_id", 285], ["deliverable_type", "Rooler::Rule"], ["rule_id", 284], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 284]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 285]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (19.5ms) Date: Mon, 17 Mar 2014 17:58:54 +0100 From: from@example.com To: test@email.com Message-ID: <532729ce5e59f_34ee3fe519835ad4645cf@Yonahs-MacBook-Pro.local.mail> Subject: subject-9 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-9 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 16:58:54.404152' WHERE "rooler_deliveries"."id" = 92 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 92]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "instance_checker_method", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 60], ["created_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["instance_checker_method", "present?"], ["klass_finder_method", "all"], ["klass_name", "Rooler::Rule"], ["method_params", nil], ["name", "rule-11"], ["template_id", 286], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 286]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 286 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 286) LIMIT 1 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", Mon, 17 Mar 2014 16:58:54 UTC +00:00], ["deliverable_id", 286], ["deliverable_type", "Rooler::Rule"], ["rule_id", 286], ["updated_at", Mon, 17 Mar 2014 16:58:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 16:58:54.428167' WHERE "rooler_rules"."id" = 286  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 286]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (8.8ms) 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", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 287], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 287 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 287) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["deliverable_id", 287], ["deliverable_type", "Rooler::Rule"], ["rule_id", 287], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 287]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.6ms) Sent mail to test_name@to.com (25.4ms) Date: Mon, 17 Mar 2014 18:17:49 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53272e3de1293_36253ff3a1c35ad0566c2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method --------------------------------------------------------------------------------------- PG::UndefinedTable: ERROR: relation "foos" does not exist LINE 5: WHERE a.attrelid = '"foos"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"foos"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 288], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 288]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) PG::UndefinedTable: ERROR: relation "foos" does not exist LINE 1: SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) ^ : SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. -------------------------------------------------------------------------------------------------------- PG::UndefinedTable: ERROR: relation "foos" does not exist LINE 5: WHERE a.attrelid = '"foos"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"foos"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays ------------------------------------------------------------------------------------------------------------------------------------- PG::UndefinedTable: ERROR: relation "foos" does not exist LINE 5: WHERE a.attrelid = '"foos"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"foos"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:08:49 UTC +00:00], ["method_params", nil], ["name", "rule-2"], ["template_id", 289], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:06:49 UTC +00:00], ["method_params", nil], ["name", "rule-3"], ["template_id", 290], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-4"], ["template_id", 291], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 292], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 293], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 294], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 293 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 294) LIMIT 1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["deliverable_id", 294], ["deliverable_type", "Rooler::Rule"], ["rule_id", 293], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 293]] 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", 294]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.9ms) Date: Mon, 17 Mar 2014 18:17:50 +0100 From: from@example.com To: test@email.com Message-ID: <53272e3e1058f_36253ff3a1c35ad056796@Yonahs-MacBook-Pro.local.mail> Subject: subject-6 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-6 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:17:50.079941' WHERE "rooler_deliveries"."id" = 95 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 95]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:17:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-8"], ["template_id", 295], ["updated_at", Mon, 17 Mar 2014 17:17:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) PG::UndefinedTable: ERROR: relation "foos" does not exist LINE 1: SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) ^ : SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Mon, 17 Mar 2014 17:18:45 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 17:18:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 1], ["updated_at", Mon, 17 Mar 2014 17:18:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 1) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:18:45 UTC +00:00], ["deliverable_id", 1], ["deliverable_type", "Rooler::Rule"], ["rule_id", 1], ["updated_at", Mon, 17 Mar 2014 17:18:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 1]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.8ms) Sent mail to test_name@to.com (23.2ms) Date: Mon, 17 Mar 2014 18:18:46 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53272e761fecc_363d3fdad9435adc636b7@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 2], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 3], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 4], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:18:46.208980' WHERE "rooler_rules"."id" = 4  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 5], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays -------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 6], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 6 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 4) LIMIT 1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["deliverable_id", 4], ["deliverable_type", "Foo"], ["rule_id", 6], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:18:46.264007' WHERE "rooler_rules"."id" = 6  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 7], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:09:46 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 8], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:07:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 9], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 10], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 11], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 12], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 13], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 12 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 13) LIMIT 1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["deliverable_id", 13], ["deliverable_type", "Rooler::Rule"], ["rule_id", 12], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 12]] 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", 13]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (17.6ms) Date: Mon, 17 Mar 2014 18:18:46 +0100 From: from@example.com To: test@email.com Message-ID: <53272e765c8c8_363d3fdad9435adc63777@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:18:46.393294' WHERE "rooler_deliveries"."id" = 3 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 3]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:18:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 14], ["updated_at", Mon, 17 Mar 2014 17:18:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 14]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:18:46.411032' WHERE "rooler_rules"."id" = 14  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 15], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 15 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 15) LIMIT 1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["deliverable_id", 15], ["deliverable_type", "Rooler::Rule"], ["rule_id", 15], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 15]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.3ms) Sent mail to test_name@to.com (23.6ms) Date: Mon, 17 Mar 2014 18:21:59 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53272f375daf8_36673fd7c5035ad428be@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 16], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 17], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 18], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 18]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 18 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 7) LIMIT 1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["deliverable_id", 7], ["deliverable_type", "Foo"], ["rule_id", 18], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.479198' WHERE "rooler_rules"."id" = 18  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 18 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 7) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.507870' WHERE "rooler_rules"."id" = 18  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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-4"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 19], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays -------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 20], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 20]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 20 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 10) LIMIT 1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["deliverable_id", 10], ["deliverable_type", "Foo"], ["rule_id", 20], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.554355' WHERE "rooler_rules"."id" = 20  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 21], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:12:59 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 22], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:10:59 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 23], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 24], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 25], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 26], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 27], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 26 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 27) LIMIT 1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["deliverable_id", 27], ["deliverable_type", "Rooler::Rule"], ["rule_id", 26], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 26]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 27]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (21.3ms) Date: Mon, 17 Mar 2014 18:21:59 +0100 From: from@example.com To: test@email.com Message-ID: <53272f37a850c_36673fd7c5035ad429eb@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:21:59.707540' WHERE "rooler_deliveries"."id" = 7 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 7]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 28], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 28]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 28 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 12) LIMIT 1 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", Mon, 17 Mar 2014 17:21:59 UTC +00:00], ["deliverable_id", 12], ["deliverable_type", "Foo"], ["rule_id", 28], ["updated_at", Mon, 17 Mar 2014 17:21:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:21:59.738814' WHERE "rooler_rules"."id" = 28  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 12]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 29], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 29 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Rooler::Rule"], ["rule_id", 29], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 29]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.7ms) Sent mail to test_name@to.com (23.3ms) Date: Mon, 17 Mar 2014 18:30:39 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5327313faa158_36cc3fdb94c35adc8705@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 30], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 31], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 32], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 32]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 32 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 14) LIMIT 1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["deliverable_id", 14], ["deliverable_type", "Foo"], ["rule_id", 32], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:39.782031' WHERE "rooler_rules"."id" = 32  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 32 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 14) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:39.806484' WHERE "rooler_rules"."id" = 32  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 33], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays -------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 34], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 34 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 17) LIMIT 1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["deliverable_id", 17], ["deliverable_type", "Foo"], ["rule_id", 34], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:39.846828' WHERE "rooler_rules"."id" = 34  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 35], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:21:39 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 36], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:19:39 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 37], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 38], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 39], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 40], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 41], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 40 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 41) LIMIT 1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["deliverable_id", 41], ["deliverable_type", "Rooler::Rule"], ["rule_id", 40], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 40]] 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", 41]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.9ms) Date: Mon, 17 Mar 2014 18:30:39 +0100 From: from@example.com To: test@email.com Message-ID: <5327313febc43_36cc3fdb94c35adc87122@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:30:39.977735' WHERE "rooler_deliveries"."id" = 12 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 12]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:30:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 42], ["updated_at", Mon, 17 Mar 2014 17:30:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 42]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 42 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 19) LIMIT 1 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", Mon, 17 Mar 2014 17:30:40 UTC +00:00], ["deliverable_id", 19], ["deliverable_type", "Foo"], ["rule_id", 42], ["updated_at", Mon, 17 Mar 2014 17:30:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:30:40.005202' WHERE "rooler_rules"."id" = 42  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 43], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 43 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 43) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["deliverable_id", 43], ["deliverable_type", "Rooler::Rule"], ["rule_id", 43], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.0ms) 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", 43]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.4ms) Sent mail to test_name@to.com (23.1ms) Date: Mon, 17 Mar 2014 18:31:47 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273183b60fc_36df3fece8c35ae066337@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 44], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 45], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 46], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 46]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 46 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 21) LIMIT 1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["deliverable_id", 21], ["deliverable_type", "Foo"], ["rule_id", 46], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:47.839270' WHERE "rooler_rules"."id" = 46  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 46 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 21) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:47.861509' WHERE "rooler_rules"."id" = 46  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 47], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays -------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 48], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 48]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 48 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 24) LIMIT 1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["deliverable_id", 24], ["deliverable_type", "Foo"], ["rule_id", 48], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:47.901508' WHERE "rooler_rules"."id" = 48  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 49], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:22:47 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 50], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:20:47 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 51], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 52], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 53], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 54], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 55], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 54 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 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", Mon, 17 Mar 2014 17:31:47 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Rooler::Rule"], ["rule_id", 54], ["updated_at", Mon, 17 Mar 2014 17:31:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 54]] 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", 55]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.2ms) Date: Mon, 17 Mar 2014 18:31:48 +0100 From: from@example.com To: test@email.com Message-ID: <532731845d41_36df3fece8c35ae0664b3@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:31:48.036259' WHERE "rooler_deliveries"."id" = 17 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 17]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:31:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:48 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:31:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 56], ["updated_at", Mon, 17 Mar 2014 17:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 56]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 56 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 26) LIMIT 1 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", Mon, 17 Mar 2014 17:31:48 UTC +00:00], ["deliverable_id", 26], ["deliverable_type", "Foo"], ["rule_id", 56], ["updated_at", Mon, 17 Mar 2014 17:31:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:31:48.061408' WHERE "rooler_rules"."id" = 56  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 26]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 57], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 57 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 57) LIMIT 1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["deliverable_id", 57], ["deliverable_type", "Rooler::Rule"], ["rule_id", 57], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 57]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.4ms) Sent mail to test_name@to.com (23.5ms) Date: Mon, 17 Mar 2014 18:32:09 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273199d1887_36ed3fc2a1c35ad418019@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 58], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 59], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 60], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 60 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 28) LIMIT 1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["deliverable_id", 28], ["deliverable_type", "Foo"], ["rule_id", 60], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:09.943796' WHERE "rooler_rules"."id" = 60  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 60 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 28) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:09.965625' WHERE "rooler_rules"."id" = 60  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 61], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_or_arrays -------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 62], ["updated_at", Mon, 17 Mar 2014 17:32:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 62 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 31) LIMIT 1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["deliverable_id", 31], ["deliverable_type", "Foo"], ["rule_id", 62], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:10.009960' WHERE "rooler_rules"."id" = 62  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 63], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 62]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:23:10 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 64], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:21:10 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 65], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 66], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 67], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 68], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 69], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 68 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 69) LIMIT 1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["deliverable_id", 69], ["deliverable_type", "Rooler::Rule"], ["rule_id", 68], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 68]] 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", 69]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.3ms) Date: Mon, 17 Mar 2014 18:32:10 +0100 From: from@example.com To: test@email.com Message-ID: <5327319a1f7eb_36ed3fc2a1c35ad4181dc@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 17:32:10.141461' WHERE "rooler_deliveries"."id" = 22 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 22]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 70], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 70]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 70 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 33) LIMIT 1 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", Mon, 17 Mar 2014 17:32:10 UTC +00:00], ["deliverable_id", 33], ["deliverable_type", "Foo"], ["rule_id", 70], ["updated_at", Mon, 17 Mar 2014 17:32:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 17:32:10.166973' WHERE "rooler_rules"."id" = 70  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 33]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (8.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:03:51 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:03:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 71], ["updated_at", Mon, 17 Mar 2014 18:03:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 71 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 71) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:03:51 UTC +00:00], ["deliverable_id", 71], ["deliverable_type", "Rooler::Rule"], ["rule_id", 71], ["updated_at", Mon, 17 Mar 2014 18:03:51 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 71]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.0ms) Sent mail to test_name@to.com (23.9ms) Date: Mon, 17 Mar 2014 19:03:52 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273908246_384b3fdebcc35ad490717@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 72], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 73], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 74], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 74]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 74 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 35) LIMIT 1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["deliverable_id", 35], ["deliverable_type", "Foo"], ["rule_id", 74], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.097337' WHERE "rooler_rules"."id" = 74  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 74 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 35) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.118015' WHERE "rooler_rules"."id" = 74  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 75], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 76], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 76]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 76 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 38) LIMIT 1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["deliverable_id", 38], ["deliverable_type", "Foo"], ["rule_id", 76], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.161965' WHERE "rooler_rules"."id" = 76  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 77], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]] Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.8ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:54:52 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 78], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:52:52 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 79], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 80], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 81], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 82], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 83], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 82 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 83) LIMIT 1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["deliverable_id", 83], ["deliverable_type", "Rooler::Rule"], ["rule_id", 82], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.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", 82]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 83]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.3ms) Date: Mon, 17 Mar 2014 19:03:52 +0100 From: from@example.com To: test@email.com Message-ID: <53273908460f6_384b3fdebcc35ad49089e@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:03:52.298307' WHERE "rooler_deliveries"."id" = 27 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 27]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 84], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 84]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 84 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 40) LIMIT 1 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", Mon, 17 Mar 2014 18:03:52 UTC +00:00], ["deliverable_id", 40], ["deliverable_type", "Foo"], ["rule_id", 84], ["updated_at", Mon, 17 Mar 2014 18:03:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:03:52.324237' WHERE "rooler_rules"."id" = 84  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 40]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 85], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 85 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 85) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["deliverable_id", 85], ["deliverable_type", "Rooler::Rule"], ["rule_id", 85], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 85]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.3ms) Sent mail to test_name@to.com (26.6ms) Date: Mon, 17 Mar 2014 19:04:33 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5327393157add_385a3fe969435ad46203@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 86], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 87], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 88], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 88]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 88 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 42) LIMIT 1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["deliverable_id", 42], ["deliverable_type", "Foo"], ["rule_id", 88], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.449767' WHERE "rooler_rules"."id" = 88  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 88 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 42) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.470800' WHERE "rooler_rules"."id" = 88  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 89], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 90], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 90 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 45) LIMIT 1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["deliverable_id", 45], ["deliverable_type", "Foo"], ["rule_id", 90], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.511810' WHERE "rooler_rules"."id" = 90  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 91], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 90]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 90]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 90]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:55:33 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 92], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:53:33 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 93], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", 600], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 94], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 95], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 96], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 97], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 97) LIMIT 1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["deliverable_id", 97], ["deliverable_type", "Rooler::Rule"], ["rule_id", 96], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 96]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 97]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.6ms) Date: Mon, 17 Mar 2014 19:04:33 +0100 From: from@example.com To: test@email.com Message-ID: <53273931a07d3_385a3fe969435ad46215d@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:04:33.669139' WHERE "rooler_deliveries"."id" = 32 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 32]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 98], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 98 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 47) LIMIT 1 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", Mon, 17 Mar 2014 18:04:33 UTC +00:00], ["deliverable_id", 47], ["deliverable_type", "Foo"], ["rule_id", 98], ["updated_at", Mon, 17 Mar 2014 18:04:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:04:33.697275' WHERE "rooler_rules"."id" = 98  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 47]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 99], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 99 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 99) LIMIT 1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["deliverable_id", 99], ["deliverable_type", "Rooler::Rule"], ["rule_id", 99], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.0ms) 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", 99]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.6ms) Sent mail to test_name@to.com (22.6ms) Date: Mon, 17 Mar 2014 19:05:22 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273962a68dc_38713fc4fd035adc97423@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (2.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 100], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 101], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 102], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 102]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 102 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 49) LIMIT 1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["deliverable_id", 49], ["deliverable_type", "Foo"], ["rule_id", 102], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:22.774863' WHERE "rooler_rules"."id" = 102  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 102 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 49) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:22.796764' WHERE "rooler_rules"."id" = 102  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 103], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 104], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 104 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 52) LIMIT 1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["deliverable_id", 52], ["deliverable_type", "Foo"], ["rule_id", 104], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:22.839972' WHERE "rooler_rules"."id" = 104  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 105], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 104]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 104]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 104]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:56:22 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 106], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:54:22 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 107], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 108], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 109], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 110], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 111], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 110 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 111) LIMIT 1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["deliverable_id", 111], ["deliverable_type", "Rooler::Rule"], ["rule_id", 110], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.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", 110]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 111]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.3ms) Date: Mon, 17 Mar 2014 19:05:22 +0100 From: from@example.com To: test@email.com Message-ID: <53273962ec3d1_38713fc4fd035adc975d2@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:05:22.979115' WHERE "rooler_deliveries"."id" = 37 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 37]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 112], ["updated_at", Mon, 17 Mar 2014 18:05:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 112 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 54) LIMIT 1 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", Mon, 17 Mar 2014 18:05:23 UTC +00:00], ["deliverable_id", 54], ["deliverable_type", "Foo"], ["rule_id", 112], ["updated_at", Mon, 17 Mar 2014 18:05:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:23.006208' WHERE "rooler_rules"."id" = 112  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 54]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (11.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", Mon, 17 Mar 2014 18:05:43 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:05:43 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 113], ["updated_at", Mon, 17 Mar 2014 18:05:43 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 113 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 113) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["deliverable_id", 113], ["deliverable_type", "Rooler::Rule"], ["rule_id", 113], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 113]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.9ms) Sent mail to test_name@to.com (30.2ms) Date: Mon, 17 Mar 2014 19:05:44 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532739782e664_387d3fec09835ad87381a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 114], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 115], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 116], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 116 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 56) LIMIT 1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["deliverable_id", 56], ["deliverable_type", "Foo"], ["rule_id", 116], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.288314' WHERE "rooler_rules"."id" = 116  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 116 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 56) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.309465' WHERE "rooler_rules"."id" = 116  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 117], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 118], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 118]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 118 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 59) LIMIT 1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["deliverable_id", 59], ["deliverable_type", "Foo"], ["rule_id", 118], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.353528' WHERE "rooler_rules"."id" = 118  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 119], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 118]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 118]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 118]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:56:44 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 120], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:54:44 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 121], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-9"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 122], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 123], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 124], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 125], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 124 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 125) LIMIT 1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["deliverable_id", 125], ["deliverable_type", "Rooler::Rule"], ["rule_id", 124], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 124]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 125]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (16.5ms) Date: Mon, 17 Mar 2014 19:05:44 +0100 From: from@example.com To: test@email.com Message-ID: <53273978776bd_387d3fec09835ad873996@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:05:44.503579' WHERE "rooler_deliveries"."id" = 42 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 42]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 126], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 126 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 61) LIMIT 1 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", Mon, 17 Mar 2014 18:05:44 UTC +00:00], ["deliverable_id", 61], ["deliverable_type", "Foo"], ["rule_id", 126], ["updated_at", Mon, 17 Mar 2014 18:05:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:05:44.532434' WHERE "rooler_rules"."id" = 126  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 61]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 127], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 127 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Rooler::Rule"], ["rule_id", 127], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 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", 127]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.5ms) Sent mail to test_name@to.com (22.9ms) Date: Mon, 17 Mar 2014 19:06:20 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5327399c48279_388b3fcdc4835adc69484@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 128], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 129], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 130], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 130]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 130 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 63) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["deliverable_id", 63], ["deliverable_type", "Foo"], ["rule_id", 130], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.392123' WHERE "rooler_rules"."id" = 130  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 130 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 63) LIMIT 1  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.415415' WHERE "rooler_rules"."id" = 130  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-4"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 131], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.5ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 132], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 132]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 132 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 66) LIMIT 1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["deliverable_id", 66], ["deliverable_type", "Foo"], ["rule_id", 132], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.460924' WHERE "rooler_rules"."id" = 132  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 133], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:57:20 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 134], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:55:20 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 135], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.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", 600], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 136], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 137], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 138], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 139], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 138 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 139) LIMIT 1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["deliverable_id", 139], ["deliverable_type", "Rooler::Rule"], ["rule_id", 138], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 138]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 139]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.4ms) Date: Mon, 17 Mar 2014 19:06:20 +0100 From: from@example.com To: test@email.com Message-ID: <5327399c8effa_388b3fcdc4835adc6957b@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:06:20.597337' WHERE "rooler_deliveries"."id" = 47 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 47]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 140], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 140]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 140 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 68) LIMIT 1 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", Mon, 17 Mar 2014 18:06:20 UTC +00:00], ["deliverable_id", 68], ["deliverable_type", "Foo"], ["rule_id", 140], ["updated_at", Mon, 17 Mar 2014 18:06:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:20.624471' WHERE "rooler_rules"."id" = 140  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 68]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 141], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 141 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 141) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["deliverable_id", 141], ["deliverable_type", "Rooler::Rule"], ["rule_id", 141], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 141]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.5ms) Sent mail to test_name@to.com (25.1ms) Date: Mon, 17 Mar 2014 19:06:34 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532739aa87869_38953fcd4d035ad439458@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 142], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 143], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 144], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 144]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 144 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 70) LIMIT 1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["deliverable_id", 70], ["deliverable_type", "Foo"], ["rule_id", 144], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.642257' WHERE "rooler_rules"."id" = 144  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 144 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 70) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.663594' WHERE "rooler_rules"."id" = 144  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 145], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 146], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 146]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 146 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 73) LIMIT 1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["deliverable_id", 73], ["deliverable_type", "Foo"], ["rule_id", 146], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.708785' WHERE "rooler_rules"."id" = 146  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 147], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 146]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:57:34 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 148], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:55:34 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 149], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 150], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 151], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 152], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 153], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 152 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 153) LIMIT 1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["deliverable_id", 153], ["deliverable_type", "Rooler::Rule"], ["rule_id", 152], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 152]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 153]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (18.8ms) Date: Mon, 17 Mar 2014 19:06:34 +0100 From: from@example.com To: test@email.com Message-ID: <532739aacb5f7_38953fcd4d035ad4395cc@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:06:34.849888' WHERE "rooler_deliveries"."id" = 52 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 52]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 154], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 154]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 154 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 75) LIMIT 1 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", Mon, 17 Mar 2014 18:06:34 UTC +00:00], ["deliverable_id", 75], ["deliverable_type", "Foo"], ["rule_id", 154], ["updated_at", Mon, 17 Mar 2014 18:06:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:06:34.876307' WHERE "rooler_rules"."id" = 154  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 75]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (9.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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 155], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 155 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 155) LIMIT 1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["deliverable_id", 155], ["deliverable_type", "Rooler::Rule"], ["rule_id", 155], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.4ms) 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", 155]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.7ms) Sent mail to test_name@to.com (25.2ms) Date: Mon, 17 Mar 2014 19:07:13 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532739d19aa19_38a53fe200435ae05707b@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 156], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 157], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 158], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 158 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["deliverable_id", 77], ["deliverable_type", "Foo"], ["rule_id", 158], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.720583' WHERE "rooler_rules"."id" = 158  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 158 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.751538' WHERE "rooler_rules"."id" = 158  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 159], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 160], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 160]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 160 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 80) LIMIT 1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["deliverable_id", 80], ["deliverable_type", "Foo"], ["rule_id", 160], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.796857' WHERE "rooler_rules"."id" = 160  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 161], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 160]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:58:13 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 162], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:56:13 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 163], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 164], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 165], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 166], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 167], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 166 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Rooler::Rule"], ["rule_id", 166], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 166]] 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", 167]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.7ms) Sent mail to test@email.com (15.9ms) Date: Mon, 17 Mar 2014 19:07:13 +0100 From: from@example.com To: test@email.com Message-ID: <532739d1e28a8_38a53fe200435ae057182@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:07:13.940687' WHERE "rooler_deliveries"."id" = 57 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 57]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 168], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 168]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 168 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 82) LIMIT 1 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", Mon, 17 Mar 2014 18:07:13 UTC +00:00], ["deliverable_id", 82], ["deliverable_type", "Foo"], ["rule_id", 168], ["updated_at", Mon, 17 Mar 2014 18:07:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:13.969388' WHERE "rooler_rules"."id" = 168  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 82]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 169], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 169 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 169) LIMIT 1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["deliverable_id", 169], ["deliverable_type", "Rooler::Rule"], ["rule_id", 169], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 169]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.6ms) Sent mail to test_name@to.com (23.1ms) Date: Mon, 17 Mar 2014 19:07:33 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532739e578f8c_38b03fdc1a035ad051919@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 170], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 171], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 172], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 172]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 172 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 84) LIMIT 1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["deliverable_id", 84], ["deliverable_type", "Foo"], ["rule_id", 172], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.583541' WHERE "rooler_rules"."id" = 172  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 172 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 84) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.605341' WHERE "rooler_rules"."id" = 172  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 173], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 174], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 174 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 87) LIMIT 1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["deliverable_id", 87], ["deliverable_type", "Foo"], ["rule_id", 174], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.650072' WHERE "rooler_rules"."id" = 174  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 175], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 174]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:58:33 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 176], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:56:33 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 177], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 178], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 179], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 180], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 181], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 180 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 181) LIMIT 1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["deliverable_id", 181], ["deliverable_type", "Rooler::Rule"], ["rule_id", 180], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 180]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 181]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.6ms) Date: Mon, 17 Mar 2014 19:07:33 +0100 From: from@example.com To: test@email.com Message-ID: <532739e5bbadf_38b03fdc1a035ad0520be@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:07:33.780534' WHERE "rooler_deliveries"."id" = 62 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 62]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 182], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 182]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 182 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1 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", Mon, 17 Mar 2014 18:07:33 UTC +00:00], ["deliverable_id", 89], ["deliverable_type", "Foo"], ["rule_id", 182], ["updated_at", Mon, 17 Mar 2014 18:07:33 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:33.806398' WHERE "rooler_rules"."id" = 182  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 89]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 183], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 183 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Rooler::Rule"], ["rule_id", 183], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 183]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.4ms) Sent mail to test_name@to.com (22.7ms) Date: Mon, 17 Mar 2014 19:07:52 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532739f8608af_38bc3ff031c35ad058263@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 184], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 185], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 186], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 186]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 186 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Foo"], ["rule_id", 186], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.489273' WHERE "rooler_rules"."id" = 186  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 186 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.511811' WHERE "rooler_rules"."id" = 186  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 187], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 188], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 188 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 94) LIMIT 1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["deliverable_id", 94], ["deliverable_type", "Foo"], ["rule_id", 188], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.557107' WHERE "rooler_rules"."id" = 188  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 189], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:58:52 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 190], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:56:52 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 191], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 192], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 193], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 194], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 195], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 194 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 195) LIMIT 1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["deliverable_id", 195], ["deliverable_type", "Rooler::Rule"], ["rule_id", 194], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 194]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 195]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (15.0ms) Date: Mon, 17 Mar 2014 19:07:52 +0100 From: from@example.com To: test@email.com Message-ID: <532739f8a69ad_38bc3ff031c35ad058395@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:07:52.695670' WHERE "rooler_deliveries"."id" = 67 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 67]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 196], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 196]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 196 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 96) LIMIT 1 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", Mon, 17 Mar 2014 18:07:52 UTC +00:00], ["deliverable_id", 96], ["deliverable_type", "Foo"], ["rule_id", 196], ["updated_at", Mon, 17 Mar 2014 18:07:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:07:52.721443' WHERE "rooler_rules"."id" = 196  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 96]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:09:40 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:09:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 197], ["updated_at", Mon, 17 Mar 2014 18:09:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 197 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:40 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Rooler::Rule"], ["rule_id", 197], ["updated_at", Mon, 17 Mar 2014 18:09:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 197]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (51.7ms) Sent mail to test_name@to.com (27.6ms) Date: Mon, 17 Mar 2014 19:09:41 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273a6512309_38db3fdf90435ad030676@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 198], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 199], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 200], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 200]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 200 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 98) LIMIT 1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["deliverable_id", 98], ["deliverable_type", "Foo"], ["rule_id", 200], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.177711' WHERE "rooler_rules"."id" = 200  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 200 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 98) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.200729' WHERE "rooler_rules"."id" = 200  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 201], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 202], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 202]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 202]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 202 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 101) LIMIT 1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["deliverable_id", 101], ["deliverable_type", "Foo"], ["rule_id", 202], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.245694' WHERE "rooler_rules"."id" = 202  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 203], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 202]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:00:41 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 204], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:58:41 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 205], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 206], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 207], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 208], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 209], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 208 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 209) LIMIT 1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["deliverable_id", 209], ["deliverable_type", "Rooler::Rule"], ["rule_id", 208], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 208]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 209]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (18.6ms) Date: Mon, 17 Mar 2014 19:09:41 +0100 From: from@example.com To: test@email.com Message-ID: <53273a65592f7_38db3fdf90435ad0307ae@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:09:41.381794' WHERE "rooler_deliveries"."id" = 72 Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 72]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 210], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 210]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 210 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1 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", Mon, 17 Mar 2014 18:09:41 UTC +00:00], ["deliverable_id", 103], ["deliverable_type", "Foo"], ["rule_id", 210], ["updated_at", Mon, 17 Mar 2014 18:09:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:09:41.410259' WHERE "rooler_rules"."id" = 210  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 103]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 211], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 211 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Rooler::Rule"], ["rule_id", 211], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.0ms) 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", 211]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.1ms) Sent mail to test_name@to.com (25.9ms) Date: Mon, 17 Mar 2014 19:10:49 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273aa95a724_39023fecc2035ae0153d8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 212], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 213], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 214], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 214 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 105) LIMIT 1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["deliverable_id", 105], ["deliverable_type", "Foo"], ["rule_id", 214], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.465277' WHERE "rooler_rules"."id" = 214  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (105)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.470342' WHERE "rooler_rules"."id" = 214  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 215], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 216], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 216]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 216]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 216]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 216 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 108) LIMIT 1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["deliverable_id", 108], ["deliverable_type", "Foo"], ["rule_id", 216], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.519677' WHERE "rooler_rules"."id" = 216  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 217], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 216]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 216]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (108)) Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:01:49 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 218], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 17:59:49 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 219], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 220], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-10"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 221], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 222], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 223], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 222 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 223) LIMIT 1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["deliverable_id", 223], ["deliverable_type", "Rooler::Rule"], ["rule_id", 222], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 222]] 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", 223]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (15.4ms) Date: Mon, 17 Mar 2014 19:10:49 +0100 From: from@example.com To: test@email.com Message-ID: <53273aa99e517_39023fecc2035ae015470@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:10:49.661814' WHERE "rooler_deliveries"."id" = 77 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 77]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 224], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 224 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 110) LIMIT 1 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", Mon, 17 Mar 2014 18:10:49 UTC +00:00], ["deliverable_id", 110], ["deliverable_type", "Foo"], ["rule_id", 224], ["updated_at", Mon, 17 Mar 2014 18:10:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:10:49.690154' WHERE "rooler_rules"."id" = 224  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 110]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Mon, 17 Mar 2014 18:11:47 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:11:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 225], ["updated_at", Mon, 17 Mar 2014 18:11:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 225 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 225) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["deliverable_id", 225], ["deliverable_type", "Rooler::Rule"], ["rule_id", 225], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 225]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.5ms) Sent mail to test_name@to.com (22.9ms) Date: Mon, 17 Mar 2014 19:11:48 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273ae433362_391a3fe5d4c35ad83339f@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 226], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 227], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 228], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 228]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 228 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 112) LIMIT 1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["deliverable_id", 112], ["deliverable_type", "Foo"], ["rule_id", 228], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.295782' WHERE "rooler_rules"."id" = 228  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 228]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (112)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.302708' WHERE "rooler_rules"."id" = 228  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 229], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 230], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 230]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 230]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 230]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 230 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 115) LIMIT 1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["deliverable_id", 115], ["deliverable_type", "Foo"], ["rule_id", 230], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.347139' WHERE "rooler_rules"."id" = 230  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 231], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 230]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (115)) Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]]  (0.3ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:02:48 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 232], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:00:48 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 233], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 234], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 235], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 236], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 237], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 236 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 237) LIMIT 1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["deliverable_id", 237], ["deliverable_type", "Rooler::Rule"], ["rule_id", 236], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 236]] 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", 237]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (19.1ms) Date: Mon, 17 Mar 2014 19:11:48 +0100 From: from@example.com To: test@email.com Message-ID: <53273ae472bc5_391a3fe5d4c35ad83349a@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:11:48.486641' WHERE "rooler_deliveries"."id" = 82 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 82]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 238], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 238 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 117) LIMIT 1 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", Mon, 17 Mar 2014 18:11:48 UTC +00:00], ["deliverable_id", 117], ["deliverable_type", "Foo"], ["rule_id", 238], ["updated_at", Mon, 17 Mar 2014 18:11:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:11:48.514351' WHERE "rooler_rules"."id" = 238  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 117]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 239], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 239 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 239) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["deliverable_id", 239], ["deliverable_type", "Rooler::Rule"], ["rule_id", 239], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 239]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.4ms) Sent mail to test_name@to.com (24.5ms) Date: Mon, 17 Mar 2014 19:12:14 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273afeb9181_392a3fe6dcc35ad4503f1@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 240], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 241], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 242], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 119) LIMIT 1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["deliverable_id", 119], ["deliverable_type", "Foo"], ["rule_id", 242], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:14.847345' WHERE "rooler_rules"."id" = 242  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (119)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:14.853379' WHERE "rooler_rules"."id" = 242  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 243], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 244], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 244]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 244]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 244]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 244 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 122) LIMIT 1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["deliverable_id", 122], ["deliverable_type", "Foo"], ["rule_id", 244], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:14.900579' WHERE "rooler_rules"."id" = 244  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 245], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 244]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 244]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (122)) Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 245]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 245]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:03:14 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 246], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:01:14 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 247], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 248], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 249], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 250], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:14 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 251], ["updated_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 250 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 251) LIMIT 1 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", Mon, 17 Mar 2014 18:12:15 UTC +00:00], ["deliverable_id", 251], ["deliverable_type", "Rooler::Rule"], ["rule_id", 250], ["updated_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 250]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 251]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (18.7ms) Date: Mon, 17 Mar 2014 19:12:15 +0100 From: from@example.com To: test@email.com Message-ID: <53273aff7e30_392a3fe6dcc35ad450415@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:12:15.049287' WHERE "rooler_deliveries"."id" = 87 Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 87]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-13"], ["created_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 252], ["updated_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 252]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 252 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 124) LIMIT 1 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", Mon, 17 Mar 2014 18:12:15 UTC +00:00], ["deliverable_id", 124], ["deliverable_type", "Foo"], ["rule_id", 252], ["updated_at", Mon, 17 Mar 2014 18:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:12:15.081287' WHERE "rooler_rules"."id" = 252  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 124]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 253], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 253 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 253) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["deliverable_id", 253], ["deliverable_type", "Rooler::Rule"], ["rule_id", 253], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 253]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.0ms) Sent mail to test_name@to.com (32.6ms) Date: Mon, 17 Mar 2014 19:14:38 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273b8e9a521_394d3fd665035ae0838e8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 254], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 255], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 256], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 256 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 126) LIMIT 1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["deliverable_id", 126], ["deliverable_type", "Foo"], ["rule_id", 256], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.726654' WHERE "rooler_rules"."id" = 256  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (126)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.731815' WHERE "rooler_rules"."id" = 256  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 257], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 258], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 258]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 258]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 258]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 258 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 129) LIMIT 1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["deliverable_id", 129], ["deliverable_type", "Foo"], ["rule_id", 258], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.778208' WHERE "rooler_rules"."id" = 258  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:05:38 UTC +00:00], ["method_params", nil], ["name", "rule-6"], ["template_id", 259], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:03:38 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 260], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-8"], ["template_id", 261], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 262], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 263], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 264], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 263 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 264) LIMIT 1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["deliverable_id", 264], ["deliverable_type", "Rooler::Rule"], ["rule_id", 263], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 263]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 264]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.2ms) Date: Mon, 17 Mar 2014 19:14:38 +0100 From: from@example.com To: test@email.com Message-ID: <53273b8ed26d0_394d3fd665035ae083921@Yonahs-MacBook-Pro.local.mail> Subject: subject-10 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-10 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:14:38.873574' WHERE "rooler_deliveries"."id" = 92 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 92]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 265], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 265]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 265 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 130) LIMIT 1 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", Mon, 17 Mar 2014 18:14:38 UTC +00:00], ["deliverable_id", 130], ["deliverable_type", "Foo"], ["rule_id", 265], ["updated_at", Mon, 17 Mar 2014 18:14:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:14:38.899665' WHERE "rooler_rules"."id" = 265  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 130]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 266], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 266 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 266) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["deliverable_id", 266], ["deliverable_type", "Rooler::Rule"], ["rule_id", 266], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 266]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (83.7ms) Sent mail to test_name@to.com (31.1ms) Date: Mon, 17 Mar 2014 19:15:05 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273ba9a5d5b_395d3fde74835ad04587@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 267], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 268], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 269], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 269 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 132) LIMIT 1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["deliverable_id", 132], ["deliverable_type", "Foo"], ["rule_id", 269], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:05.786066' WHERE "rooler_rules"."id" = 269  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (132)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:05.792160' WHERE "rooler_rules"."id" = 269  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 270], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 271], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 271]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 271 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 135) LIMIT 1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["deliverable_id", 135], ["deliverable_type", "Foo"], ["rule_id", 271], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:05.836919' WHERE "rooler_rules"."id" = 271  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 271]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 272], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 271]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (135)) Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 272]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 272]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:06:05 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 273], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:04:05 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 274], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 275], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-10"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 276], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 277], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 278], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 277 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 278) LIMIT 1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["deliverable_id", 278], ["deliverable_type", "Rooler::Rule"], ["rule_id", 277], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 277]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 278]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.0ms) Date: Mon, 17 Mar 2014 19:15:05 +0100 From: from@example.com To: test@email.com Message-ID: <53273ba9eb5ce_395d3fde74835ad04692@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:15:05.975876' WHERE "rooler_deliveries"."id" = 97 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 97]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 279], ["updated_at", Mon, 17 Mar 2014 18:15:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 279]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 279 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 137) LIMIT 1 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", Mon, 17 Mar 2014 18:15:06 UTC +00:00], ["deliverable_id", 137], ["deliverable_type", "Foo"], ["rule_id", 279], ["updated_at", Mon, 17 Mar 2014 18:15:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:06.002658' WHERE "rooler_rules"."id" = 279  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 137]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 280], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 280 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 280) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["deliverable_id", 280], ["deliverable_type", "Rooler::Rule"], ["rule_id", 280], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 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", 280]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.5ms) Sent mail to test_name@to.com (23.5ms) Date: Mon, 17 Mar 2014 19:15:47 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273bd343037_39723ffb3dc35adc1743b@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 281], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 282], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 283], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 283]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 283 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 139) LIMIT 1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["deliverable_id", 139], ["deliverable_type", "Foo"], ["rule_id", 283], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.361825' WHERE "rooler_rules"."id" = 283  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 283]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (139)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.369009' WHERE "rooler_rules"."id" = 283  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 284], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 285], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 285]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 285 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 142) LIMIT 1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["deliverable_id", 142], ["deliverable_type", "Foo"], ["rule_id", 285], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.413825' WHERE "rooler_rules"."id" = 285  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 285]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 286], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 285]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (142)) Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:06:47 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 287], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:04:47 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 288], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 289], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 290], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 291], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 292], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 291 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 292) LIMIT 1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["deliverable_id", 292], ["deliverable_type", "Rooler::Rule"], ["rule_id", 291], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 291]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 292]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (15.9ms) Date: Mon, 17 Mar 2014 19:15:47 +0100 From: from@example.com To: test@email.com Message-ID: <53273bd38398a_39723ffb3dc35adc175ba@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:15:47.553112' WHERE "rooler_deliveries"."id" = 102 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 102]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 293], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 293]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 293 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 144) LIMIT 1 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", Mon, 17 Mar 2014 18:15:47 UTC +00:00], ["deliverable_id", 144], ["deliverable_type", "Foo"], ["rule_id", 293], ["updated_at", Mon, 17 Mar 2014 18:15:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:15:47.580628' WHERE "rooler_rules"."id" = 293  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 144]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.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", Mon, 17 Mar 2014 18:17:10 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:17:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 294], ["updated_at", Mon, 17 Mar 2014 18:17:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 294 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 294) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:10 UTC +00:00], ["deliverable_id", 294], ["deliverable_type", "Rooler::Rule"], ["rule_id", 294], ["updated_at", Mon, 17 Mar 2014 18:17:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 294]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.8ms) Sent mail to test_name@to.com (24.0ms) Date: Mon, 17 Mar 2014 19:17:11 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273c2719864_39893fd681435ad4916d@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 295], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 296], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 297], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 297]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 297 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 146) LIMIT 1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["deliverable_id", 146], ["deliverable_type", "Foo"], ["rule_id", 297], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.191419' WHERE "rooler_rules"."id" = 297  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 297]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (146)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.197443' WHERE "rooler_rules"."id" = 297  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 298], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 299], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 299]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 299 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 299], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.242005' WHERE "rooler_rules"."id" = 299  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 299]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 300], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 299]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (149)) Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 300]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 300]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:08:11 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 301], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:06:11 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 302], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 303], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 304], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 305], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 306], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 305 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 306) LIMIT 1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["deliverable_id", 306], ["deliverable_type", "Rooler::Rule"], ["rule_id", 305], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 305]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 306]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.3ms) Date: Mon, 17 Mar 2014 19:17:11 +0100 From: from@example.com To: test@email.com Message-ID: <53273c275b1f2_39893fd681435ad49178@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:17:11.384660' WHERE "rooler_deliveries"."id" = 107 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 107]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 307], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 307]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 307 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1 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", Mon, 17 Mar 2014 18:17:11 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Foo"], ["rule_id", 307], ["updated_at", Mon, 17 Mar 2014 18:17:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:17:11.414655' WHERE "rooler_rules"."id" = 307  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 151]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.6ms) SAVEPOINT active_record_1 SQL (7.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 308], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 308 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 308) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["deliverable_id", 308], ["deliverable_type", "Rooler::Rule"], ["rule_id", 308], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 308]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.7ms) Sent mail to test_name@to.com (26.7ms) Date: Mon, 17 Mar 2014 19:19:34 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273cb6b5192_39ac3fd1ccc35ae0380ab@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 309], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 310], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 311], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 311]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 311 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 153) LIMIT 1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["deliverable_id", 153], ["deliverable_type", "Foo"], ["rule_id", 311], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.831048' WHERE "rooler_rules"."id" = 311  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 311]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (153)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.836200' WHERE "rooler_rules"."id" = 311  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 312], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 313], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 314], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 313 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 156) LIMIT 1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["deliverable_id", 156], ["deliverable_type", "Foo"], ["rule_id", 313], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.889958' WHERE "rooler_rules"."id" = 313 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 314 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 156) LIMIT 1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["deliverable_id", 156], ["deliverable_type", "Foo"], ["rule_id", 314], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:34.898849' WHERE "rooler_rules"."id" = 314  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (156))  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:10:34 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 315], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:08:34 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 316], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 317], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 318], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 319], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 320], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 319 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 320) LIMIT 1 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", Mon, 17 Mar 2014 18:19:34 UTC +00:00], ["deliverable_id", 320], ["deliverable_type", "Rooler::Rule"], ["rule_id", 319], ["updated_at", Mon, 17 Mar 2014 18:19:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 319]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 320]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.5ms) Date: Mon, 17 Mar 2014 19:19:35 +0100 From: from@example.com To: test@email.com Message-ID: <53273cb7386d_39ac3fd1ccc35ae038152@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:19:35.026864' WHERE "rooler_deliveries"."id" = 113 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 113]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:19:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:19:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:35 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:19:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:19:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 321], ["updated_at", Mon, 17 Mar 2014 18:19:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 321]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 321 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1 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", Mon, 17 Mar 2014 18:19:35 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Foo"], ["rule_id", 321], ["updated_at", Mon, 17 Mar 2014 18:19:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:19:35.053065' WHERE "rooler_rules"."id" = 321  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 158]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 322], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 322 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["deliverable_id", 322], ["deliverable_type", "Rooler::Rule"], ["rule_id", 322], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 322]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.0ms) Sent mail to test_name@to.com (23.1ms) Date: Mon, 17 Mar 2014 19:20:05 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273cd5ba960_39b83ff1c5835ad027264@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 323], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 324], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 325], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 325]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 325 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 160) LIMIT 1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["deliverable_id", 160], ["deliverable_type", "Foo"], ["rule_id", 325], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.855561' WHERE "rooler_rules"."id" = 325  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 325]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (160)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.861541' WHERE "rooler_rules"."id" = 325  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 326], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 327], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-6"], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 328], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 327]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 327 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Foo"], ["rule_id", 327], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.913670' WHERE "rooler_rules"."id" = 327 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 328]]  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 328 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Foo"], ["rule_id", 328], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:05.922152' WHERE "rooler_rules"."id" = 328  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 327]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 327]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (163)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 328]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 328]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:11:05 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 329], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:09:05 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 330], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 331], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 332], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 333], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 334], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 333 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 334) LIMIT 1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["deliverable_id", 334], ["deliverable_type", "Rooler::Rule"], ["rule_id", 333], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 333]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 334]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.0ms) Date: Mon, 17 Mar 2014 19:20:06 +0100 From: from@example.com To: test@email.com Message-ID: <53273cd6a2a7_39b83ff1c5835ad027310@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:20:06.053514' WHERE "rooler_deliveries"."id" = 119 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 119]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 335], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 335 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 165) LIMIT 1 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", Mon, 17 Mar 2014 18:20:06 UTC +00:00], ["deliverable_id", 165], ["deliverable_type", "Foo"], ["rule_id", 335], ["updated_at", Mon, 17 Mar 2014 18:20:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:06.080172' WHERE "rooler_rules"."id" = 335  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 165]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 336], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 336 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 336) LIMIT 1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["deliverable_id", 336], ["deliverable_type", "Rooler::Rule"], ["rule_id", 336], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 336]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.0ms) Sent mail to test_name@to.com (23.4ms) Date: Mon, 17 Mar 2014 19:20:37 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273cf56d1bd_39c73fe421c35ad8107f@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 337], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 338], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 339], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 339]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 339 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Foo"], ["rule_id", 339], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.535526' WHERE "rooler_rules"."id" = 339  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 339]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (167)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.540336' WHERE "rooler_rules"."id" = 339  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 340], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 341], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 342], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 341]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 341]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 341]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 341 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 170) LIMIT 1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["deliverable_id", 170], ["deliverable_type", "Foo"], ["rule_id", 341], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.594537' WHERE "rooler_rules"."id" = 341 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 342 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 170) LIMIT 1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["deliverable_id", 170], ["deliverable_type", "Foo"], ["rule_id", 342], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.603086' WHERE "rooler_rules"."id" = 342  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 342]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:11:37 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 343], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:09:37 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 344], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 345], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 346], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 347], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 348], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 347 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 348) LIMIT 1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["deliverable_id", 348], ["deliverable_type", "Rooler::Rule"], ["rule_id", 347], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 347]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 348]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.4ms) Date: Mon, 17 Mar 2014 19:20:37 +0100 From: from@example.com To: test@email.com Message-ID: <53273cf5a78fd_39c73fe421c35ad8119e@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:20:37.697909' WHERE "rooler_deliveries"."id" = 125 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 125]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 349], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 349 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 171) LIMIT 1 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", Mon, 17 Mar 2014 18:20:37 UTC +00:00], ["deliverable_id", 171], ["deliverable_type", "Foo"], ["rule_id", 349], ["updated_at", Mon, 17 Mar 2014 18:20:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:37.728862' WHERE "rooler_rules"."id" = 349  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 171]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 350], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 350 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 350) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["deliverable_id", 350], ["deliverable_type", "Rooler::Rule"], ["rule_id", 350], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 350]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.6ms) Sent mail to test_name@to.com (23.1ms) Date: Mon, 17 Mar 2014 19:20:57 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273d097b5ab_39d13fecc1435ad8349f1@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 351], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 352], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 353], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 353]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 353 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Foo"], ["rule_id", 353], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.599368' WHERE "rooler_rules"."id" = 353  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 353]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (173)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.606057' WHERE "rooler_rules"."id" = 353  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 354], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 355], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 356], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 355]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 355]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 355]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 355 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 176) LIMIT 1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["deliverable_id", 176], ["deliverable_type", "Foo"], ["rule_id", 355], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.660801' WHERE "rooler_rules"."id" = 355 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 356]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 356 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 176) LIMIT 1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["deliverable_id", 176], ["deliverable_type", "Foo"], ["rule_id", 356], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.669006' WHERE "rooler_rules"."id" = 356  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 356]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 356]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 356]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 355]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 355]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (176)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 356]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 356]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:11:57 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 357], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:09:57 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 358], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 359], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 360], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 361], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 362], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 361 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 362) LIMIT 1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["deliverable_id", 362], ["deliverable_type", "Rooler::Rule"], ["rule_id", 361], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.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", 361]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 362]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.0ms) Date: Mon, 17 Mar 2014 19:20:57 +0100 From: from@example.com To: test@email.com Message-ID: <53273d09c0e99_39d13fecc1435ad835027@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:20:57.802259' WHERE "rooler_deliveries"."id" = 131 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 131]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 363], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 363]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 363 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 178) LIMIT 1 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", Mon, 17 Mar 2014 18:20:57 UTC +00:00], ["deliverable_id", 178], ["deliverable_type", "Foo"], ["rule_id", 363], ["updated_at", Mon, 17 Mar 2014 18:20:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:20:57.829522' WHERE "rooler_rules"."id" = 363  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 178]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (9.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 364], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 364 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 364) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["deliverable_id", 364], ["deliverable_type", "Rooler::Rule"], ["rule_id", 364], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 364]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.9ms) Sent mail to test_name@to.com (23.3ms) Date: Mon, 17 Mar 2014 19:22:35 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273d6b866a8_39e93fe755835adc42010@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 365], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 366], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 367], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 180) LIMIT 1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["deliverable_id", 180], ["deliverable_type", "Foo"], ["rule_id", 367], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.647216' WHERE "rooler_rules"."id" = 367  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (180)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.651964' WHERE "rooler_rules"."id" = 367  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 368], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 369], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 370], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 369]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 369]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 369]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 369 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Foo"], ["rule_id", 369], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.705669' WHERE "rooler_rules"."id" = 369 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 370]]  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 370 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Foo"], ["rule_id", 370], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.714867' WHERE "rooler_rules"."id" = 370  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 370]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 370]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 370]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 369]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 369]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (183)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 370]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 370]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:13:35 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 371], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:11:35 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 372], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 373], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 374], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 375], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 376], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 375 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 376) LIMIT 1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["deliverable_id", 376], ["deliverable_type", "Rooler::Rule"], ["rule_id", 375], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 375]] Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 376]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.7ms) Date: Mon, 17 Mar 2014 19:22:35 +0100 From: from@example.com To: test@email.com Message-ID: <53273d6bcb8e7_39e93fe755835adc421fe@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:22:35.845629' WHERE "rooler_deliveries"."id" = 137 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 137]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 377], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 377]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 377 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1 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", Mon, 17 Mar 2014 18:22:35 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 377], ["updated_at", Mon, 17 Mar 2014 18:22:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:22:35.871613' WHERE "rooler_rules"."id" = 377  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 185]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 378], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 378 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 378) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["deliverable_id", 378], ["deliverable_type", "Rooler::Rule"], ["rule_id", 378], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 378]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.3ms) Sent mail to test_name@to.com (28.7ms) Date: Mon, 17 Mar 2014 19:23:11 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273d8fa5abb_39fd3ffbe1435ae0193@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 379], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 380], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-3"], ["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 381], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 381 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 187) LIMIT 1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["deliverable_id", 187], ["deliverable_type", "Foo"], ["rule_id", 381], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.766416' WHERE "rooler_rules"."id" = 381  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (187)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.771342' WHERE "rooler_rules"."id" = 381  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 382], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 383], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 384], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 383]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 383 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 190) LIMIT 1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["deliverable_id", 190], ["deliverable_type", "Foo"], ["rule_id", 383], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.828113' WHERE "rooler_rules"."id" = 383 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 384 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 190) LIMIT 1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["deliverable_id", 190], ["deliverable_type", "Foo"], ["rule_id", 384], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.836268' WHERE "rooler_rules"."id" = 384  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 384]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 383]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (190)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 384]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:14:11 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 385], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:12:11 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 386], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 387], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 388], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 389], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 390], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 389 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 390) LIMIT 1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["deliverable_id", 390], ["deliverable_type", "Rooler::Rule"], ["rule_id", 389], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 389]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 390]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.6ms) Sent mail to test@email.com (16.4ms) Date: Mon, 17 Mar 2014 19:23:11 +0100 From: from@example.com To: test@email.com Message-ID: <53273d8fe9f93_39fd3ffbe1435ae020ed@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:23:11.971119' WHERE "rooler_deliveries"."id" = 143 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 143]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 391], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 391]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 391 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 192) LIMIT 1 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", Mon, 17 Mar 2014 18:23:11 UTC +00:00], ["deliverable_id", 192], ["deliverable_type", "Foo"], ["rule_id", 391], ["updated_at", Mon, 17 Mar 2014 18:23:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:11.998691' WHERE "rooler_rules"."id" = 391  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 192]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (12.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:23:38 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:23:38 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 392], ["updated_at", Mon, 17 Mar 2014 18:23:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 392 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 392) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["deliverable_id", 392], ["deliverable_type", "Rooler::Rule"], ["rule_id", 392], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 392]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.5ms) Sent mail to test_name@to.com (23.3ms) Date: Mon, 17 Mar 2014 19:23:39 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273dab327dc_3a093fc2c8435ad898db@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 393], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 394], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 395], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 395]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 395 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 194) LIMIT 1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["deliverable_id", 194], ["deliverable_type", "Foo"], ["rule_id", 395], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.295216' WHERE "rooler_rules"."id" = 395  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 395]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (194)) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.301119' WHERE "rooler_rules"."id" = 395  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 396], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 397], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 398], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 397]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 397]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 397]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 397 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Foo"], ["rule_id", 397], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.352341' WHERE "rooler_rules"."id" = 397 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 398 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Foo"], ["rule_id", 398], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.359882' WHERE "rooler_rules"."id" = 398  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 397]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 397]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (197)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:14:39 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 399], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:12:39 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 400], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 401], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 402], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 403], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 404], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 403 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 404) LIMIT 1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["deliverable_id", 404], ["deliverable_type", "Rooler::Rule"], ["rule_id", 403], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 403]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 404]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.6ms) Date: Mon, 17 Mar 2014 19:23:39 +0100 From: from@example.com To: test@email.com Message-ID: <53273dab7384e_3a093fc2c8435ad89977@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:23:39.484926' WHERE "rooler_deliveries"."id" = 149 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 149]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 405], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 405]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 405 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1 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", Mon, 17 Mar 2014 18:23:39 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Foo"], ["rule_id", 405], ["updated_at", Mon, 17 Mar 2014 18:23:39 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:23:39.513065' WHERE "rooler_rules"."id" = 405  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 199]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 406], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 406 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 406) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["deliverable_id", 406], ["deliverable_type", "Rooler::Rule"], ["rule_id", 406], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 406]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (60.1ms) Sent mail to test_name@to.com (53.2ms) Date: Mon, 17 Mar 2014 19:26:34 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273e5ab9d03_3a323fea31c35ae0356@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.8ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.0ms) 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 407], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (3.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 408], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.8ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 409], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 409 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 201) LIMIT 1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["deliverable_id", 201], ["deliverable_type", "Foo"], ["rule_id", 409], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.920287' WHERE "rooler_rules"."id" = 409  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (201)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.925601' WHERE "rooler_rules"."id" = 409  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 410], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 411], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 412], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 411]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 411]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 411]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 411 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 204) LIMIT 1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["deliverable_id", 204], ["deliverable_type", "Foo"], ["rule_id", 411], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.987165' WHERE "rooler_rules"."id" = 411 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 412 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 204) LIMIT 1 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", Mon, 17 Mar 2014 18:26:34 UTC +00:00], ["deliverable_id", 204], ["deliverable_type", "Foo"], ["rule_id", 412], ["updated_at", Mon, 17 Mar 2014 18:26:34 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:34.997346' WHERE "rooler_rules"."id" = 412  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 412]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 412]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 411]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 411]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (204)) Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 412]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:17:35 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 413], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:15:35 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 414], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-9"], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 415], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 416], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 417], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 418], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 417 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 418) LIMIT 1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["deliverable_id", 418], ["deliverable_type", "Rooler::Rule"], ["rule_id", 417], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.0ms) 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", 417]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 418]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (15.8ms) Date: Mon, 17 Mar 2014 19:26:35 +0100 From: from@example.com To: test@email.com Message-ID: <53273e5b22926_3a323fea31c35ae0367b@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:26:35.155394' WHERE "rooler_deliveries"."id" = 155 Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 155]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 419], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 419]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 419 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1 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", Mon, 17 Mar 2014 18:26:35 UTC +00:00], ["deliverable_id", 206], ["deliverable_type", "Foo"], ["rule_id", 419], ["updated_at", Mon, 17 Mar 2014 18:26:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:26:35.184713' WHERE "rooler_rules"."id" = 419  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 206]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 420], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 420 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 420) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["deliverable_id", 420], ["deliverable_type", "Rooler::Rule"], ["rule_id", 420], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 420]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.3ms) Sent mail to test_name@to.com (23.8ms) Date: Mon, 17 Mar 2014 19:30:24 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273f409bf54_3a673fd201035ad0830f@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 421], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 422], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 423], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 423]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 423 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 208) LIMIT 1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["deliverable_id", 208], ["deliverable_type", "Foo"], ["rule_id", 423], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.732274' WHERE "rooler_rules"."id" = 423  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 423]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (208)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.737829' WHERE "rooler_rules"."id" = 423  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 424], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 425], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 426], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 425]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 425]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 425]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 425 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Foo"], ["rule_id", 425], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.792165' WHERE "rooler_rules"."id" = 425 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 426]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 426 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Foo"], ["rule_id", 426], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.800476' WHERE "rooler_rules"."id" = 426  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 426]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 425]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:21:24 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 427], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:19:24 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 428], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 429], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 430], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 431], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 432], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 431 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 432) LIMIT 1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["deliverable_id", 432], ["deliverable_type", "Rooler::Rule"], ["rule_id", 431], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 431]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 432]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.5ms) Date: Mon, 17 Mar 2014 19:30:24 +0100 From: from@example.com To: test@email.com Message-ID: <53273f40df437_3a673fd201035ad083137@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:30:24.926228' WHERE "rooler_deliveries"."id" = 161 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 161]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 433], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 433 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 213) LIMIT 1 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", Mon, 17 Mar 2014 18:30:24 UTC +00:00], ["deliverable_id", 213], ["deliverable_type", "Foo"], ["rule_id", 433], ["updated_at", Mon, 17 Mar 2014 18:30:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:24.954561' WHERE "rooler_rules"."id" = 433  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 213]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:30:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:30:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 434], ["updated_at", Mon, 17 Mar 2014 18:30:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 434 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 434) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["deliverable_id", 434], ["deliverable_type", "Rooler::Rule"], ["rule_id", 434], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 434]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.0ms) Sent mail to test_name@to.com (23.5ms) Date: Mon, 17 Mar 2014 19:30:47 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273f5726893_3a753fd5a5c35ae0729bf@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 435], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 436], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 437], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 437]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 437 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 215) LIMIT 1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["deliverable_id", 215], ["deliverable_type", "Foo"], ["rule_id", 437], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.250165' WHERE "rooler_rules"."id" = 437  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 437]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (215)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.255486' WHERE "rooler_rules"."id" = 437  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 438], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 439], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 440], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 439]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 439]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 439]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 439 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 218) LIMIT 1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["deliverable_id", 218], ["deliverable_type", "Foo"], ["rule_id", 439], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.309873' WHERE "rooler_rules"."id" = 439 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 440]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 440 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 218) LIMIT 1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["deliverable_id", 218], ["deliverable_type", "Foo"], ["rule_id", 440], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.318842' WHERE "rooler_rules"."id" = 440  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 440]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 439]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:21:47 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 441], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:19:47 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 442], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 443], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 444], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.1ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 445], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 446], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 445 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 446) LIMIT 1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["deliverable_id", 446], ["deliverable_type", "Rooler::Rule"], ["rule_id", 445], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 445]] 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", 446]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (21.1ms) Date: Mon, 17 Mar 2014 19:30:47 +0100 From: from@example.com To: test@email.com Message-ID: <53273f5768b9a_3a753fd5a5c35ae073093@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:30:47.448347' WHERE "rooler_deliveries"."id" = 167 Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 167]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 447], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 447]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 447 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 220) LIMIT 1 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", Mon, 17 Mar 2014 18:30:47 UTC +00:00], ["deliverable_id", 220], ["deliverable_type", "Foo"], ["rule_id", 447], ["updated_at", Mon, 17 Mar 2014 18:30:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:30:47.478006' WHERE "rooler_rules"."id" = 447  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 220]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:32:51 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:32:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 448], ["updated_at", Mon, 17 Mar 2014 18:32:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 448 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 448) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:32:51 UTC +00:00], ["deliverable_id", 448], ["deliverable_type", "Rooler::Rule"], ["rule_id", 448], ["updated_at", Mon, 17 Mar 2014 18:32:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 448]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.4ms) Sent mail to test_name@to.com (24.9ms) Date: Mon, 17 Mar 2014 19:32:52 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53273fd4e443_3a903fe390c35ad8170fe@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 449], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 450], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-3"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 451], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 451 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 222) LIMIT 1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["deliverable_id", 222], ["deliverable_type", "Foo"], ["rule_id", 451], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.148939' WHERE "rooler_rules"."id" = 451  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 451 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 222) LIMIT 1  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.172216' WHERE "rooler_rules"."id" = 451  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 452], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 453], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 454], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 453]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1) Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 453 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 225) LIMIT 1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["deliverable_id", 225], ["deliverable_type", "Foo"], ["rule_id", 453], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.228497' WHERE "rooler_rules"."id" = 453 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]  (0.2ms) SAVEPOINT active_record_1 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" = 225) LIMIT 1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["deliverable_id", 225], ["deliverable_type", "Foo"], ["rule_id", 454], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.239619' WHERE "rooler_rules"."id" = 454  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 454]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 453]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (225)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 454]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:23:52 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 455], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:21:52 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 456], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 457], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 458], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 459], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 460], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 459 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 460) LIMIT 1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["deliverable_id", 460], ["deliverable_type", "Rooler::Rule"], ["rule_id", 459], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 459]] 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", 460]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.9ms) Date: Mon, 17 Mar 2014 19:32:52 +0100 From: from@example.com To: test@email.com Message-ID: <53273fd453c83_3a903fe390c35ad8171e2@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:32:52.354451' WHERE "rooler_deliveries"."id" = 173 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 173]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 461], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 461]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 461 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 227) LIMIT 1 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", Mon, 17 Mar 2014 18:32:52 UTC +00:00], ["deliverable_id", 227], ["deliverable_type", "Foo"], ["rule_id", 461], ["updated_at", Mon, 17 Mar 2014 18:32:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:32:52.379623' WHERE "rooler_rules"."id" = 461  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 227]]  (0.7ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 462], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 462 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 462) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["deliverable_id", 462], ["deliverable_type", "Rooler::Rule"], ["rule_id", 462], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 462]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (40.6ms) Sent mail to test_name@to.com (23.6ms) Date: Mon, 17 Mar 2014 19:46:53 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5327431dd1fc1_3b3b3fe820c35ad04033@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 463], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 464], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 465], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 465]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 466], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 467], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 468], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 468]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 467]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 467]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:37:54 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 469], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:35:54 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 470], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 471], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 472], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 473], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 474], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 473 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 474) LIMIT 1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["deliverable_id", 474], ["deliverable_type", "Rooler::Rule"], ["rule_id", 473], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 473]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 474]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.3ms) Date: Mon, 17 Mar 2014 19:46:54 +0100 From: from@example.com To: test@email.com Message-ID: <5327431e180c6_3b3b3fe820c35ad04045d@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:46:54.110340' WHERE "rooler_deliveries"."id" = 176 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 176]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:46:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 475], ["updated_at", Mon, 17 Mar 2014 18:46:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 475]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Mon, 17 Mar 2014 18:48:22 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:48:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 476], ["updated_at", Mon, 17 Mar 2014 18:48:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 476 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 476) LIMIT 1 SQL (1.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", Mon, 17 Mar 2014 18:48:22 UTC +00:00], ["deliverable_id", 476], ["deliverable_type", "Rooler::Rule"], ["rule_id", 476], ["updated_at", Mon, 17 Mar 2014 18:48:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 476]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.6ms) Sent mail to test_name@to.com (23.4ms) Date: Mon, 17 Mar 2014 19:48:22 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53274376ecf97_3b523fceb5035ad4749ce@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 477], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 478], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 479], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 479]]  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 479]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 479 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 236) LIMIT 1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["deliverable_id", 236], ["deliverable_type", "Foo"], ["rule_id", 479], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:48:23.064852' WHERE "rooler_rules"."id" = 479  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 479]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 479]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (236)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:48:23.072542' WHERE "rooler_rules"."id" = 479  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 480], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 481], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 482], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 482]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 482]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 481]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 481]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.6ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:39:23 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 483], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:37:23 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 484], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 485], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 486], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 487], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 488], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 487 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 488) LIMIT 1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["deliverable_id", 488], ["deliverable_type", "Rooler::Rule"], ["rule_id", 487], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 487]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 488]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.3ms) Date: Mon, 17 Mar 2014 19:48:23 +0100 From: from@example.com To: test@email.com Message-ID: <53274377371a8_3b523fceb5035ad4750bd@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:48:23.237910' WHERE "rooler_deliveries"."id" = 179 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 179]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 489], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 489]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 489 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 241) LIMIT 1 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", Mon, 17 Mar 2014 18:48:23 UTC +00:00], ["deliverable_id", 241], ["deliverable_type", "Foo"], ["rule_id", 489], ["updated_at", Mon, 17 Mar 2014 18:48:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:48:23.266744' WHERE "rooler_rules"."id" = 489  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 241]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (9.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 490], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 490 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 490) LIMIT 1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["deliverable_id", 490], ["deliverable_type", "Rooler::Rule"], ["rule_id", 490], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 490]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.4ms) Sent mail to test_name@to.com (22.5ms) Date: Mon, 17 Mar 2014 19:49:16 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532743aca59fe_3b6b3ff249035ae078681@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 491], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 492], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 493], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 493]]  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 493]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 493 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 243) LIMIT 1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["deliverable_id", 243], ["deliverable_type", "Foo"], ["rule_id", 493], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:49:16.766066' WHERE "rooler_rules"."id" = 493  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 493]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 493]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (243)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:49:16.772887' WHERE "rooler_rules"."id" = 493  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 494], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 495], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 496], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 496]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 496]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 495]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 495]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.5ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:40:16 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 497], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 17 Mar 2014 18:38:16 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 498], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 499], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 500], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 501], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 502], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 501 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 502) LIMIT 1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["deliverable_id", 502], ["deliverable_type", "Rooler::Rule"], ["rule_id", 501], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 501]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 502]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.8ms) Date: Mon, 17 Mar 2014 19:49:16 +0100 From: from@example.com To: test@email.com Message-ID: <532743ace1883_3b6b3ff249035ae0787c3@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-17 18:49:16.935887' WHERE "rooler_deliveries"."id" = 183 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 183]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 503], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 503]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 503]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 503 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 248) LIMIT 1 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", Mon, 17 Mar 2014 18:49:16 UTC +00:00], ["deliverable_id", 248], ["deliverable_type", "Foo"], ["rule_id", 503], ["updated_at", Mon, 17 Mar 2014 18:49:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-17 18:49:16.963743' WHERE "rooler_rules"."id" = 503  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 248]]  (0.4ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (22.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 504], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 504 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 504) LIMIT 1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["deliverable_id", 504], ["deliverable_type", "Rooler::Rule"], ["rule_id", 504], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.0ms) 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", 504]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (54.9ms) Sent mail to test_name@to.com (41.5ms) Date: Tue, 18 Mar 2014 10:12:15 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53280defac803_61e83feea5435ad45379a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 505], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 506], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 507], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 507]]  (1.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 507 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 250) LIMIT 1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["deliverable_id", 250], ["deliverable_type", "Foo"], ["rule_id", 507], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 09:12:15.843252' WHERE "rooler_rules"."id" = 507  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 507]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (250)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 09:12:15.850141' WHERE "rooler_rules"."id" = 507  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 508], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (1.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 509], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 510], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 510]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 510]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 509]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 509]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) ROLLBACK  (0.5ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 09:03:15 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 511], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 09:01:15 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 512], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:15 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 513], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 514], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 515], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 516], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 515 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 516) LIMIT 1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["deliverable_id", 516], ["deliverable_type", "Rooler::Rule"], ["rule_id", 515], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 515]] 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", 516]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.5ms) Date: Tue, 18 Mar 2014 10:12:16 +0100 From: from@example.com To: test@email.com Message-ID: <53280df0f63f_61e83feea5435ad45383f@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 09:12:16.074730' WHERE "rooler_deliveries"."id" = 187 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 187]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-13"], ["created_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 517], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 517]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 517]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 517 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 255) LIMIT 1 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", Tue, 18 Mar 2014 09:12:16 UTC +00:00], ["deliverable_id", 255], ["deliverable_type", "Foo"], ["rule_id", 517], ["updated_at", Tue, 18 Mar 2014 09:12:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 09:12:16.104731' WHERE "rooler_rules"."id" = 517  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 255]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (16.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 518], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 518 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 518) LIMIT 1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["deliverable_id", 518], ["deliverable_type", "Rooler::Rule"], ["rule_id", 518], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 518]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.3ms) Sent mail to test_name@to.com (29.8ms) Date: Tue, 18 Mar 2014 11:13:32 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53281c4c563aa_64a53fc69dc35ad455640@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 519], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 520], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 521], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 521]]  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 521]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 521 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 257) LIMIT 1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["deliverable_id", 257], ["deliverable_type", "Foo"], ["rule_id", 521], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:13:32.444154' WHERE "rooler_rules"."id" = 521  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 521]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 521]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (257)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:13:32.451096' WHERE "rooler_rules"."id" = 521  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 522], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 [1mSQL (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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 523], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 524], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 524]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 524]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 523]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 523]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.6ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:04:32 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 525], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:02:32 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 526], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-9"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 527], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 528], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 529], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-12"], ["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 530], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 529 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 530) LIMIT 1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["deliverable_id", 530], ["deliverable_type", "Rooler::Rule"], ["rule_id", 529], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.0ms) 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", 529]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 530]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (19.7ms) Date: Tue, 18 Mar 2014 11:13:32 +0100 From: from@example.com To: test@email.com Message-ID: <53281c4c9de45_64a53fc69dc35ad45578@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:13:32.664323' WHERE "rooler_deliveries"."id" = 191 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 191]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 531], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 531]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 531]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 531 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 262) LIMIT 1 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", Tue, 18 Mar 2014 10:13:32 UTC +00:00], ["deliverable_id", 262], ["deliverable_type", "Foo"], ["rule_id", 531], ["updated_at", Tue, 18 Mar 2014 10:13:32 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:13:32.695935' WHERE "rooler_rules"."id" = 531  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 262]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 532], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 532 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 532) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["deliverable_id", 532], ["deliverable_type", "Rooler::Rule"], ["rule_id", 532], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 532]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.6ms) Sent mail to test_name@to.com (22.4ms) Date: Tue, 18 Mar 2014 11:15:40 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53281cccd01a1_64c33fe49c435ad83736@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 533], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 534], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 535], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 535]]  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 535 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 264) LIMIT 1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["deliverable_id", 264], ["deliverable_type", "Foo"], ["rule_id", 535], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:15:40.945859' WHERE "rooler_rules"."id" = 535  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 535]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (264)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:15:40.954946' WHERE "rooler_rules"."id" = 535  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 536], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 537], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 538], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 538]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 538]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 537]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 537]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.5ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:06:41 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 539], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:04:41 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 540], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 541], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 542], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 543], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 544], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 543 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 544) LIMIT 1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["deliverable_id", 544], ["deliverable_type", "Rooler::Rule"], ["rule_id", 543], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 543]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 544]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.1ms) Date: Tue, 18 Mar 2014 11:15:41 +0100 From: from@example.com To: test@email.com Message-ID: <53281ccd1abbe_64c33fe49c435ad838b5@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:15:41.120794' WHERE "rooler_deliveries"."id" = 195 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 195]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 545], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 545]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 545]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 545 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 269) LIMIT 1 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", Tue, 18 Mar 2014 10:15:41 UTC +00:00], ["deliverable_id", 269], ["deliverable_type", "Foo"], ["rule_id", 545], ["updated_at", Tue, 18 Mar 2014 10:15:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:15:41.150309' WHERE "rooler_rules"."id" = 545  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 269]]  (0.3ms) ROLLBACK  (260.7ms) DROP DATABASE IF EXISTS "dummy_test"  (1238.4ms) CREATE DATABASE "dummy_test" ENCODING = 'utf8' SQL (2.1ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"  (7.3ms) CREATE TABLE "foos" ("id" serial primary key, "created_at" timestamp, "updated_at" timestamp)  (4.6ms) CREATE TABLE "rooler_deliveries" ("id" serial primary key, "deliverable_type" character varying(255), "deliverable_id" integer, "rule_id" integer, "delivered_at" timestamp, "created_at" timestamp, "updated_at" timestamp)   (5.8ms) CREATE TABLE "rooler_rules" ("id" serial primary key, "name" character varying(255), "template_id" integer, "check_frequency" integer, "last_checked_at" timestamp, "klass_name" character varying(255), "klass_finder_method" character varying(255), "instance_checker_method" character varying(255), "created_at" timestamp, "updated_at" timestamp, "method_params" character varying(255))  (5.8ms) CREATE TABLE "rooler_templates" ("id" serial primary key, "name" character varying(255), "to" character varying(255), "cc" character varying(255), "subject" character varying(255), "body" text, "created_at" timestamp, "updated_at" timestamp)   (1.6ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL)  (1.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")  (0.4ms) SELECT version FROM "schema_migrations"  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140317170346')  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20140226113304')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140226113305')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140226120455')  (0.5ms) INSERT INTO "schema_migrations" (version) VALUES ('20140313103833') ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (9.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 1], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 1) LIMIT 1 SQL (1.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", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["deliverable_id", 1], ["deliverable_type", "Rooler::Rule"], ["rule_id", 1], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 1]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.7ms) Sent mail to test_name@to.com (43.4ms) Date: Tue, 18 Mar 2014 11:39:16 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53282254db0d6_65dd3fe140435ad8952cb@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (3.4ms) ROLLBACK  (0.5ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 2], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 3], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 4], ["updated_at", Tue, 18 Mar 2014 10:39:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 4]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 4 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 2) LIMIT 1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["deliverable_id", 2], ["deliverable_type", "Foo"], ["rule_id", 4], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:39:17.032956' WHERE "rooler_rules"."id" = 4  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 4]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (2)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:39:17.041185' WHERE "rooler_rules"."id" = 4  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 5], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 6], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 7], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 7]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 6]]  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) ROLLBACK  (0.6ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:30:17 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 8], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:28:17 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 9], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 10], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 11], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 12], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 13], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 12 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 13) LIMIT 1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["deliverable_id", 13], ["deliverable_type", "Rooler::Rule"], ["rule_id", 12], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 12]] 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", 13]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (19.9ms) Date: Tue, 18 Mar 2014 11:39:17 +0100 From: from@example.com To: test@email.com Message-ID: <532822553a2f7_65dd3fe140435ad8953d0@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:39:17.255323' WHERE "rooler_deliveries"."id" = 3 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 3]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 14], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 14]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 14]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 14 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 7) LIMIT 1 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", Tue, 18 Mar 2014 10:39:17 UTC +00:00], ["deliverable_id", 7], ["deliverable_type", "Foo"], ["rule_id", 14], ["updated_at", Tue, 18 Mar 2014 10:39:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:39:17.292972' WHERE "rooler_rules"."id" = 14  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 7]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 15], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 15 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 15) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["deliverable_id", 15], ["deliverable_type", "Rooler::Rule"], ["rule_id", 15], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 15]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (40.7ms) Sent mail to test_name@to.com (23.1ms) Date: Tue, 18 Mar 2014 11:47:30 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328244258083_66463fcafd035ae04374d@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 16], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 17], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 18], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 18]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 18 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 9) LIMIT 1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["deliverable_id", 9], ["deliverable_type", "Foo"], ["rule_id", 18], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:47:30.457609' WHERE "rooler_rules"."id" = 18  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 18]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (9)) SQL (0.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:47:30.463612' WHERE "rooler_rules"."id" = 18  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 19], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 20], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 21], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 21]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 20]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 20]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.6ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:38:30 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 22], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:36:30 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 23], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 24], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 25], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 26], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 27], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 26 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 27) LIMIT 1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["deliverable_id", 27], ["deliverable_type", "Rooler::Rule"], ["rule_id", 26], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 26]] 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", 27]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.0ms) Date: Tue, 18 Mar 2014 11:47:30 +0100 From: from@example.com To: test@email.com Message-ID: <5328244297bc5_66463fcafd035ae0438da@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 10:47:30.633547' WHERE "rooler_deliveries"."id" = 7 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 7]]  (0.4ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 28], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 28]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 28 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 14) LIMIT 1 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", Tue, 18 Mar 2014 10:47:30 UTC +00:00], ["deliverable_id", 14], ["deliverable_type", "Foo"], ["rule_id", 28], ["updated_at", Tue, 18 Mar 2014 10:47:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 10:47:30.664472' WHERE "rooler_rules"."id" = 28  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 14]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (61.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 11:08:19 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:08:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 29], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 29 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Rooler::Rule"], ["rule_id", 29], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 29]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.8ms) Sent mail to test_name@to.com (27.1ms) Date: Tue, 18 Mar 2014 12:08:20 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328292450773_675f3fe8a2035adc33963@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 30], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 31], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-3"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 32], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 32]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 32 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 16) LIMIT 1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["deliverable_id", 16], ["deliverable_type", "Foo"], ["rule_id", 32], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.431173' WHERE "rooler_rules"."id" = 32  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 32]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (16)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.437913' WHERE "rooler_rules"."id" = 32  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-4"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 33], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 34], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 35], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 34 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 19) LIMIT 1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["deliverable_id", 19], ["deliverable_type", "Foo"], ["rule_id", 34], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.498592' WHERE "rooler_rules"."id" = 34 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 35]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 35 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 19) LIMIT 1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["deliverable_id", 19], ["deliverable_type", "Foo"], ["rule_id", 35], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.511312' WHERE "rooler_rules"."id" = 35  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 34]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (19)) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 35]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 35]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 35]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:59:20 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 36], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 10:57:20 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 37], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 38], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 39], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 40], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 41], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 40 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 41) LIMIT 1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["deliverable_id", 41], ["deliverable_type", "Rooler::Rule"], ["rule_id", 40], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 40]] Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 41]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (17.0ms) Date: Tue, 18 Mar 2014 12:08:20 +0100 From: from@example.com To: test@email.com Message-ID: <5328292499f54_675f3fe8a2035adc3408f@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:08:20.646340' WHERE "rooler_deliveries"."id" = 13 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 13]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 42], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 42]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 42 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 21) LIMIT 1 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", Tue, 18 Mar 2014 11:08:20 UTC +00:00], ["deliverable_id", 21], ["deliverable_type", "Foo"], ["rule_id", 42], ["updated_at", Tue, 18 Mar 2014 11:08:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:08:20.678036' WHERE "rooler_rules"."id" = 42  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 21]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 43], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 43 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 43) LIMIT 1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["deliverable_id", 43], ["deliverable_type", "Rooler::Rule"], ["rule_id", 43], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.4ms) 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", 43]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (63.0ms) Sent mail to test_name@to.com (38.6ms) Date: Tue, 18 Mar 2014 12:12:00 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53282a00d46e3_67a23fcc29c35ad4100f1@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 44], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 45], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 46], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 46]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 46 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 23) LIMIT 1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["deliverable_id", 23], ["deliverable_type", "Foo"], ["rule_id", 46], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:00.976496' WHERE "rooler_rules"."id" = 46  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 46]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (23)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:00.982262' WHERE "rooler_rules"."id" = 46  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:00 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 47], ["updated_at", Tue, 18 Mar 2014 11:12:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 48], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 49], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 48]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 48 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 26) LIMIT 1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["deliverable_id", 26], ["deliverable_type", "Foo"], ["rule_id", 48], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:01.032004' WHERE "rooler_rules"."id" = 48 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 49 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 26) LIMIT 1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["deliverable_id", 26], ["deliverable_type", "Foo"], ["rule_id", 49], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:01.040081' WHERE "rooler_rules"."id" = 49  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 48]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 48]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (26)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 49]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:03:01 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 50], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:01:01 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 51], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 52], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 53], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 54], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 55], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 54 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Rooler::Rule"], ["rule_id", 54], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 54]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 55]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.4ms) Date: Tue, 18 Mar 2014 12:12:01 +0100 From: from@example.com To: test@email.com Message-ID: <53282a0121d06_67a23fcc29c35ad4101fb@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:12:01.150051' WHERE "rooler_deliveries"."id" = 19 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 19]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 56], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 56]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 56 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 28) LIMIT 1 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", Tue, 18 Mar 2014 11:12:01 UTC +00:00], ["deliverable_id", 28], ["deliverable_type", "Foo"], ["rule_id", 56], ["updated_at", Tue, 18 Mar 2014 11:12:01 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:01.180304' WHERE "rooler_rules"."id" = 56  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 28]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 57], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 57 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 57) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["deliverable_id", 57], ["deliverable_type", "Rooler::Rule"], ["rule_id", 57], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.4ms) 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", 57]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.3ms) Sent mail to test_name@to.com (30.7ms) Date: Tue, 18 Mar 2014 12:12:37 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53282a25dc4bd_67af3fc8ccc35ad05383e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 58], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 59], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 60], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 60]]  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 60 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 30) LIMIT 1 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", Tue, 18 Mar 2014 11:12:37 UTC +00:00], ["deliverable_id", 30], ["deliverable_type", "Foo"], ["rule_id", 60], ["updated_at", Tue, 18 Mar 2014 11:12:37 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:37.996681' WHERE "rooler_rules"."id" = 60  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 60]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (30)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.004037' WHERE "rooler_rules"."id" = 60  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 61], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 62], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 63], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 62]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 62 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 33) LIMIT 1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["deliverable_id", 33], ["deliverable_type", "Foo"], ["rule_id", 62], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.053039' WHERE "rooler_rules"."id" = 62 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 63]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 63]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 63 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 33) LIMIT 1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["deliverable_id", 33], ["deliverable_type", "Foo"], ["rule_id", 63], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.062351' WHERE "rooler_rules"."id" = 63  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 62]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (33)) Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 63]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 63]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:03:38 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 64], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:01:38 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 65], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 66], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 67], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 68], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 69], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 68 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 69) LIMIT 1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["deliverable_id", 69], ["deliverable_type", "Rooler::Rule"], ["rule_id", 68], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 68]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 69]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.8ms) Date: Tue, 18 Mar 2014 12:12:38 +0100 From: from@example.com To: test@email.com Message-ID: <53282a2625b82_67af3fc8ccc35ad053970@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:12:38.165586' WHERE "rooler_deliveries"."id" = 25 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 25]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 70], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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()) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 70]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 70]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 70 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 35) LIMIT 1 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", Tue, 18 Mar 2014 11:12:38 UTC +00:00], ["deliverable_id", 35], ["deliverable_type", "Foo"], ["rule_id", 70], ["updated_at", Tue, 18 Mar 2014 11:12:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:12:38.193289' WHERE "rooler_rules"."id" = 70  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 35]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 71], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 71 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 71) LIMIT 1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["deliverable_id", 71], ["deliverable_type", "Rooler::Rule"], ["rule_id", 71], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 71]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.7ms) Sent mail to test_name@to.com (24.4ms) Date: Tue, 18 Mar 2014 12:13:26 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53282a56decb0_67be3ffeb0435adc3778c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 72], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 73], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 74], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 74]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 74 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 37) LIMIT 1 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", Tue, 18 Mar 2014 11:13:26 UTC +00:00], ["deliverable_id", 37], ["deliverable_type", "Foo"], ["rule_id", 74], ["updated_at", Tue, 18 Mar 2014 11:13:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.000462' WHERE "rooler_rules"."id" = 74  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 74 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 37) LIMIT 1  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.020440' WHERE "rooler_rules"."id" = 74  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.4ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 75], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 76], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 77], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 76]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 76 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 40) LIMIT 1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["deliverable_id", 40], ["deliverable_type", "Foo"], ["rule_id", 76], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.072185' WHERE "rooler_rules"."id" = 76 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 77]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 77 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 40) LIMIT 1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["deliverable_id", 40], ["deliverable_type", "Foo"], ["rule_id", 77], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.080652' WHERE "rooler_rules"."id" = 77  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 76]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:04:27 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 78], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:02:27 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 79], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 80], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 81], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 82], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 83], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 82 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 83) LIMIT 1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["deliverable_id", 83], ["deliverable_type", "Rooler::Rule"], ["rule_id", 82], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 82]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 83]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (16.1ms) Date: Tue, 18 Mar 2014 12:13:27 +0100 From: from@example.com To: test@email.com Message-ID: <53282a572e362_67be3ffeb0435adc37859@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:13:27.203526' WHERE "rooler_deliveries"."id" = 31 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 31]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 84], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 84]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 84 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 42) LIMIT 1 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", Tue, 18 Mar 2014 11:13:27 UTC +00:00], ["deliverable_id", 42], ["deliverable_type", "Foo"], ["rule_id", 84], ["updated_at", Tue, 18 Mar 2014 11:13:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:13:27.230393' WHERE "rooler_rules"."id" = 84  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 42]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 85], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 85 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 85) LIMIT 1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["deliverable_id", 85], ["deliverable_type", "Rooler::Rule"], ["rule_id", 85], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 85]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (40.3ms) Sent mail to test_name@to.com (23.0ms) Date: Tue, 18 Mar 2014 12:20:22 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53282bf697bb7_68183fd6e5c35ae086260@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 86], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 87], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 88], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 88]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 88 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 44) LIMIT 1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["deliverable_id", 44], ["deliverable_type", "Foo"], ["rule_id", 88], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.706652' WHERE "rooler_rules"."id" = 88  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 88]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (44)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.712021' WHERE "rooler_rules"."id" = 88  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 89], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 90], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 91], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 90 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 47) LIMIT 1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["deliverable_id", 47], ["deliverable_type", "Foo"], ["rule_id", 90], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.757570' WHERE "rooler_rules"."id" = 90 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 91]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 91 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 47) LIMIT 1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["deliverable_id", 47], ["deliverable_type", "Foo"], ["rule_id", 91], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.766309' WHERE "rooler_rules"."id" = 91  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 90]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (47)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 91]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 91]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 91]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:11:22 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 92], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:09:22 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 93], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 94], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 95], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 96], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 97], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 97) LIMIT 1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["deliverable_id", 97], ["deliverable_type", "Rooler::Rule"], ["rule_id", 96], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 96]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 97]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (12.8ms) Date: Tue, 18 Mar 2014 12:20:22 +0100 From: from@example.com To: test@email.com Message-ID: <53282bf6d19e5_68183fd6e5c35ae0863d1@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:20:22.869798' WHERE "rooler_deliveries"."id" = 37 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 37]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 98], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 98 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 49) LIMIT 1 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", Tue, 18 Mar 2014 11:20:22 UTC +00:00], ["deliverable_id", 49], ["deliverable_type", "Foo"], ["rule_id", 98], ["updated_at", Tue, 18 Mar 2014 11:20:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:20:22.897110' WHERE "rooler_rules"."id" = 98  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 49]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Tue, 18 Mar 2014 11:25:35 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 99], ["updated_at", Tue, 18 Mar 2014 11:25:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 99 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 99) LIMIT 1 SQL (1.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", Tue, 18 Mar 2014 11:25:35 UTC +00:00], ["deliverable_id", 99], ["deliverable_type", "Rooler::Rule"], ["rule_id", 99], ["updated_at", Tue, 18 Mar 2014 11:25:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 99]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.7ms) Sent mail to test_name@to.com (23.6ms) Date: Tue, 18 Mar 2014 12:25:35 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53282d2ff0250_68533fde70435ad883653@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.8ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 100], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 101], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 102], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 102]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 102 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 51) LIMIT 1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["deliverable_id", 51], ["deliverable_type", "Foo"], ["rule_id", 102], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.074375' WHERE "rooler_rules"."id" = 102  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 102]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (51)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.079826' WHERE "rooler_rules"."id" = 102  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 103], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-5"], ["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 104], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 105], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 104 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 54) LIMIT 1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["deliverable_id", 54], ["deliverable_type", "Foo"], ["rule_id", 104], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.128755' WHERE "rooler_rules"."id" = 104 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 105]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 105 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 54) LIMIT 1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["deliverable_id", 54], ["deliverable_type", "Foo"], ["rule_id", 105], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.138036' WHERE "rooler_rules"."id" = 105  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 104]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 104]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (54)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 105]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 105]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 105]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:16:36 UTC +00:00], ["method_params", nil], ["name", "rule-7"], ["template_id", 106], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:14:36 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 107], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-9"], ["template_id", 108], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 109], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 110], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 111], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 110 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 111) LIMIT 1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["deliverable_id", 111], ["deliverable_type", "Rooler::Rule"], ["rule_id", 110], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 110]] 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", 111]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.0ms) Date: Tue, 18 Mar 2014 12:25:36 +0100 From: from@example.com To: test@email.com Message-ID: <53282d3038a8b_68533fde70435ad883746@Yonahs-MacBook-Pro.local.mail> Subject: subject-11 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-11 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:25:36.243396' WHERE "rooler_deliveries"."id" = 43 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 43]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 112], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 112 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 56) LIMIT 1 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", Tue, 18 Mar 2014 11:25:36 UTC +00:00], ["deliverable_id", 56], ["deliverable_type", "Foo"], ["rule_id", 112], ["updated_at", Tue, 18 Mar 2014 11:25:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:25:36.270984' WHERE "rooler_rules"."id" = 112  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 56]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (8.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", Tue, 18 Mar 2014 11:44:04 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:44:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 1], ["updated_at", Tue, 18 Mar 2014 11:44:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 1) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:04 UTC +00:00], ["deliverable_id", 1], ["deliverable_type", "Rooler::Rule"], ["rule_id", 1], ["updated_at", Tue, 18 Mar 2014 11:44:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 1]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.3ms) Sent mail to test_name@to.com (23.9ms) Date: Tue, 18 Mar 2014 12:44:05 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532831851452f_693a3fe025c35ad8190e3@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 2], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 3], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 4], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 4 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 2) LIMIT 1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["deliverable_id", 2], ["deliverable_type", "Foo"], ["rule_id", 4], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.178866' WHERE "rooler_rules"."id" = 4  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (2)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.184542' WHERE "rooler_rules"."id" = 4  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 5], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 6], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 7], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 6 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 5) LIMIT 1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["deliverable_id", 5], ["deliverable_type", "Foo"], ["rule_id", 6], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.233808' WHERE "rooler_rules"."id" = 6 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 7 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 5) LIMIT 1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["deliverable_id", 5], ["deliverable_type", "Foo"], ["rule_id", 7], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.243187' WHERE "rooler_rules"."id" = 7  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 6]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (5)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 7]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 8], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 8 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 7) LIMIT 1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["deliverable_id", 7], ["deliverable_type", "Foo"], ["rule_id", 8], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.281903' WHERE "rooler_rules"."id" = 8  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (7))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (7)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.288130' WHERE "rooler_rules"."id" = 8  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 7 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:35:05 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 9], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:33:05 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 10], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 11], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 12], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 13], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 14], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 13 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 14) LIMIT 1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["deliverable_id", 14], ["deliverable_type", "Rooler::Rule"], ["rule_id", 13], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 13]] 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", 14]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (16.6ms) Date: Tue, 18 Mar 2014 12:44:05 +0100 From: from@example.com To: test@email.com Message-ID: <532831855c3a8_693a3fe025c35ad819115@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:44:05.391255' WHERE "rooler_deliveries"."id" = 6 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 6]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 15], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 15]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 15 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 8) LIMIT 1 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", Tue, 18 Mar 2014 11:44:05 UTC +00:00], ["deliverable_id", 8], ["deliverable_type", "Foo"], ["rule_id", 15], ["updated_at", Tue, 18 Mar 2014 11:44:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:05.419605' WHERE "rooler_rules"."id" = 15  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 8]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (8.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 16], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 16 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 16) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 16], ["deliverable_type", "Rooler::Rule"], ["rule_id", 16], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 16]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.6ms) Sent mail to test_name@to.com (22.8ms) Date: Tue, 18 Mar 2014 12:44:45 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532831ad74ef7_69443fe704c35ad4809ca@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 17], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 18], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 19], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 19]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 19 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 10) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 10], ["deliverable_type", "Foo"], ["rule_id", 19], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.572164' WHERE "rooler_rules"."id" = 19  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 19]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (10)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.577518' WHERE "rooler_rules"."id" = 19  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 20], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 21], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-6"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 22], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 21 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 13) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 13], ["deliverable_type", "Foo"], ["rule_id", 21], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.628009' WHERE "rooler_rules"."id" = 21 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 22 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 13) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 13], ["deliverable_type", "Foo"], ["rule_id", 22], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.638056' WHERE "rooler_rules"."id" = 22  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 21]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 21]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (13)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 22]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 23], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 23]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 23 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 15) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 15], ["deliverable_type", "Foo"], ["rule_id", 23], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.672262' WHERE "rooler_rules"."id" = 23  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 23]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (15))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 23]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (15)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.678126' WHERE "rooler_rules"."id" = 23  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 15 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:35:45 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 24], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:33:45 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 25], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 26], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 27], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 28], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 29], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 28 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Rooler::Rule"], ["rule_id", 28], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 28]] 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", 29]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.0ms) Date: Tue, 18 Mar 2014 12:44:45 +0100 From: from@example.com To: test@email.com Message-ID: <532831adbb960_69443fe704c35ad48100@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:44:45.779749' WHERE "rooler_deliveries"."id" = 13 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 13]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 30], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 30]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 30 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 16) LIMIT 1 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", Tue, 18 Mar 2014 11:44:45 UTC +00:00], ["deliverable_id", 16], ["deliverable_type", "Foo"], ["rule_id", 30], ["updated_at", Tue, 18 Mar 2014 11:44:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:44:45.808191' WHERE "rooler_rules"."id" = 30  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 16]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 31], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 31 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 31) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["deliverable_id", 31], ["deliverable_type", "Rooler::Rule"], ["rule_id", 31], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 31]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (55.0ms) Sent mail to test_name@to.com (35.5ms) Date: Tue, 18 Mar 2014 12:50:25 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53283301b2246_698b3fd364c35ad872747@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 32], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 33], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-3"], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 34], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 34 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 18) LIMIT 1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["deliverable_id", 18], ["deliverable_type", "Foo"], ["rule_id", 34], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.865109' WHERE "rooler_rules"."id" = 34  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 34]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (18)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.872930' WHERE "rooler_rules"."id" = 34  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 35], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 36], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 37], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 36]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 36 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 21) LIMIT 1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["deliverable_id", 21], ["deliverable_type", "Foo"], ["rule_id", 36], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.934472' WHERE "rooler_rules"."id" = 36 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 37]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 37 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 21) LIMIT 1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["deliverable_id", 21], ["deliverable_type", "Foo"], ["rule_id", 37], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.942473' WHERE "rooler_rules"."id" = 37  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 36]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 36]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (21)) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 37]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 37]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 37]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 38], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 38]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 38 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 23) LIMIT 1 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", Tue, 18 Mar 2014 11:50:25 UTC +00:00], ["deliverable_id", 23], ["deliverable_type", "Foo"], ["rule_id", 38], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.977994' WHERE "rooler_rules"."id" = 38  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 38]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (23))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 38]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (23)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:25.984141' WHERE "rooler_rules"."id" = 38  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 23 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:50:25 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 38]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (23) [["rule_id", 38]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:41:26 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 39], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:39:26 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 40], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 41], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 42], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 43], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 44], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 43 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 44) LIMIT 1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["deliverable_id", 44], ["deliverable_type", "Rooler::Rule"], ["rule_id", 43], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 43]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 44]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.2ms) Date: Tue, 18 Mar 2014 12:50:26 +0100 From: from@example.com To: test@email.com Message-ID: <532833021663c_698b3fd364c35ad872826@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:50:26.104150' WHERE "rooler_deliveries"."id" = 20 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 20]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 45], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 45]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 45 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 24) LIMIT 1 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", Tue, 18 Mar 2014 11:50:26 UTC +00:00], ["deliverable_id", 24], ["deliverable_type", "Foo"], ["rule_id", 45], ["updated_at", Tue, 18 Mar 2014 11:50:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:50:26.134689' WHERE "rooler_rules"."id" = 45  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 24]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 46], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 46 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 46) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 46], ["deliverable_type", "Rooler::Rule"], ["rule_id", 46], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 46]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.6ms) Sent mail to test_name@to.com (23.2ms) Date: Tue, 18 Mar 2014 12:54:17 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532833e967724_69c33ff4e5035ad82337c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 47], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 48], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 49], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 49 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 26) LIMIT 1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 26], ["deliverable_type", "Foo"], ["rule_id", 49], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.513538' WHERE "rooler_rules"."id" = 49  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 49]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (26)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.519224' WHERE "rooler_rules"."id" = 49  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 50], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 51], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 52], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 51]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 51 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Foo"], ["rule_id", 51], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.565308' WHERE "rooler_rules"."id" = 51 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 52]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 52 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Foo"], ["rule_id", 52], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.572817' WHERE "rooler_rules"."id" = 52  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 51]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 51]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (29)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 52]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 52]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 52]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 53], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 53]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 53 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 31) LIMIT 1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 31], ["deliverable_type", "Foo"], ["rule_id", 53], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.604598' WHERE "rooler_rules"."id" = 53  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 53]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (31))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 53]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (31)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.610867' WHERE "rooler_rules"."id" = 53  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 31 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:45:17 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 54], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:43:17 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 55], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 56], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 57], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 58], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 59], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 58 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 59) LIMIT 1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 59], ["deliverable_type", "Rooler::Rule"], ["rule_id", 58], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 58]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 59]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.0ms) Date: Tue, 18 Mar 2014 12:54:17 +0100 From: from@example.com To: test@email.com Message-ID: <532833e9a9d82_69c33ff4e5035ad82342a@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:54:17.707068' WHERE "rooler_deliveries"."id" = 27 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 27]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 60], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 60 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 32) LIMIT 1 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", Tue, 18 Mar 2014 11:54:17 UTC +00:00], ["deliverable_id", 32], ["deliverable_type", "Foo"], ["rule_id", 60], ["updated_at", Tue, 18 Mar 2014 11:54:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:17.732799' WHERE "rooler_rules"."id" = 60  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 32]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (11.8ms) 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", Tue, 18 Mar 2014 11:54:41 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 61], ["updated_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 61 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 61) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00], ["deliverable_id", 61], ["deliverable_type", "Rooler::Rule"], ["rule_id", 61], ["updated_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 61]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (58.5ms) Sent mail to test_name@to.com (99.0ms) Date: Tue, 18 Mar 2014 12:54:41 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53283401d0050_69cb3ff811435adc95e4@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (1.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (2.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.5ms) 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", Tue, 18 Mar 2014 11:54:41 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 62], ["updated_at", Tue, 18 Mar 2014 11:54:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (1.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 63], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 64], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 64]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 64 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 34) LIMIT 1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["deliverable_id", 34], ["deliverable_type", "Foo"], ["rule_id", 64], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.061576' WHERE "rooler_rules"."id" = 64  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 64]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (34)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.068462' WHERE "rooler_rules"."id" = 64  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 65], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 66], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 67], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 66]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 66 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 37) LIMIT 1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["deliverable_id", 37], ["deliverable_type", "Foo"], ["rule_id", 66], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.132059' WHERE "rooler_rules"."id" = 66 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 67]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 67 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 37) LIMIT 1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["deliverable_id", 37], ["deliverable_type", "Foo"], ["rule_id", 67], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.142884' WHERE "rooler_rules"."id" = 67  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 66]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 66]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (37)) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 67]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 67]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 67]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 68], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]] Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 68 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 39) LIMIT 1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["deliverable_id", 39], ["deliverable_type", "Foo"], ["rule_id", 68], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.193052' WHERE "rooler_rules"."id" = 68  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (39))  (1.1ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (39)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.202844' WHERE "rooler_rules"."id" = 68  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 39 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 68]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (39) [["rule_id", 68]]  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (2.3ms) 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:45:42 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 69], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:43:42 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 70], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 71], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 72], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 73], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 74], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 73 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 74) LIMIT 1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["deliverable_id", 74], ["deliverable_type", "Rooler::Rule"], ["rule_id", 73], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 73]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 74]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (17.4ms) Date: Tue, 18 Mar 2014 12:54:42 +0100 From: from@example.com To: test@email.com Message-ID: <5328340259f31_69cb3ff811435adc965d@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:54:42.383734' WHERE "rooler_deliveries"."id" = 34 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 34]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 75], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 75]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 75 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 40) LIMIT 1 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", Tue, 18 Mar 2014 11:54:42 UTC +00:00], ["deliverable_id", 40], ["deliverable_type", "Foo"], ["rule_id", 75], ["updated_at", Tue, 18 Mar 2014 11:54:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:54:42.417786' WHERE "rooler_rules"."id" = 75  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 40]]  (0.6ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 76], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 76 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 76) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 76], ["deliverable_type", "Rooler::Rule"], ["rule_id", 76], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 76]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.2ms) Sent mail to test_name@to.com (23.2ms) Date: Tue, 18 Mar 2014 12:57:17 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328349d5aaaa_69f63fe96c835adc90919@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 77], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 78], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 79], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 79]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 79 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 42) LIMIT 1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 42], ["deliverable_type", "Foo"], ["rule_id", 79], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.459737' WHERE "rooler_rules"."id" = 79  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 79]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (42)) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.465440' WHERE "rooler_rules"."id" = 79  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 80], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 81], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 82], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 81]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 81 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 45) LIMIT 1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 45], ["deliverable_type", "Foo"], ["rule_id", 81], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.514845' WHERE "rooler_rules"."id" = 81 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 82]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 82 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 45) LIMIT 1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 45], ["deliverable_type", "Foo"], ["rule_id", 82], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.522402' WHERE "rooler_rules"."id" = 82  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 81]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 81]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (45)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 82]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 82]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 82]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 83], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 83 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 47) LIMIT 1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 47], ["deliverable_type", "Foo"], ["rule_id", 83], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.554951' WHERE "rooler_rules"."id" = 83  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (47))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (47)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.561040' WHERE "rooler_rules"."id" = 83  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 47 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (47) [["rule_id", 83]]  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 83]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (47) [["rule_id", 83]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:48:17 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 84], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:46:17 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 85], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 86], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 87], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 88], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 89], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 88 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 89], ["deliverable_type", "Rooler::Rule"], ["rule_id", 88], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 88]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 89]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.1ms) Date: Tue, 18 Mar 2014 12:57:17 +0100 From: from@example.com To: test@email.com Message-ID: <5328349da4b30_69f63fe96c835adc91093@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:57:17.686713' WHERE "rooler_deliveries"."id" = 41 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 41]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 90], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 90 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 48) LIMIT 1 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", Tue, 18 Mar 2014 11:57:17 UTC +00:00], ["deliverable_id", 48], ["deliverable_type", "Foo"], ["rule_id", 90], ["updated_at", Tue, 18 Mar 2014 11:57:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:17.715780' WHERE "rooler_rules"."id" = 90  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.1ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 48]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 91], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 91 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Rooler::Rule"], ["rule_id", 91], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 91]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.5ms) Sent mail to test_name@to.com (23.5ms) Date: Tue, 18 Mar 2014 12:57:41 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532834b556d2a_6a003fd310435ad01821b@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 92], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 93], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 94], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 94]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 94 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 50) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 50], ["deliverable_type", "Foo"], ["rule_id", 94], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.448244' WHERE "rooler_rules"."id" = 94  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 94]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (50)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.453684' WHERE "rooler_rules"."id" = 94  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 95], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 96], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 97], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 96]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 53) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 53], ["deliverable_type", "Foo"], ["rule_id", 96], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.498567' WHERE "rooler_rules"."id" = 96 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 97 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 53) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 53], ["deliverable_type", "Foo"], ["rule_id", 97], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.506355' WHERE "rooler_rules"."id" = 97  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 96]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 96]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (53)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 97]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 98], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 98 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Foo"], ["rule_id", 98], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.538614' WHERE "rooler_rules"."id" = 98  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (55))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (55)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.544924' WHERE "rooler_rules"."id" = 98  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 55 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]]  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (55) [["rule_id", 98]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:48:41 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 99], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:46:41 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 100], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", 600], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 101], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 102], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 103], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 104], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 103 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 104) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 104], ["deliverable_type", "Rooler::Rule"], ["rule_id", 103], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 103]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 104]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.6ms) Date: Tue, 18 Mar 2014 12:57:41 +0100 From: from@example.com To: test@email.com Message-ID: <532834b5a0fcd_6a003fd310435ad018392@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:57:41.671115' WHERE "rooler_deliveries"."id" = 48 Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 48]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 105], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 105]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 105 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 56) LIMIT 1 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", Tue, 18 Mar 2014 11:57:41 UTC +00:00], ["deliverable_id", 56], ["deliverable_type", "Foo"], ["rule_id", 105], ["updated_at", Tue, 18 Mar 2014 11:57:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:57:41.698827' WHERE "rooler_rules"."id" = 105  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.1ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 56]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 106], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 106 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 106) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 106], ["deliverable_type", "Rooler::Rule"], ["rule_id", 106], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 106]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (55.8ms) Sent mail to test_name@to.com (22.9ms) Date: Tue, 18 Mar 2014 12:58:11 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532834d36eaa5_6a0d3fc44cc35adc996f5@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 107], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 108], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 109], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 109]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 109 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 58) LIMIT 1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 58], ["deliverable_type", "Foo"], ["rule_id", 109], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.547176' WHERE "rooler_rules"."id" = 109  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 109]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (58)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.554415' WHERE "rooler_rules"."id" = 109  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 110], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 111], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 112], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 111]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 111 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 61) LIMIT 1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 61], ["deliverable_type", "Foo"], ["rule_id", 111], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.600785' WHERE "rooler_rules"."id" = 111 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 112 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 61) LIMIT 1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 61], ["deliverable_type", "Foo"], ["rule_id", 112], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.608421' WHERE "rooler_rules"."id" = 112  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 111]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 111]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (61)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 112]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 113], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 113 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 63) LIMIT 1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 63], ["deliverable_type", "Foo"], ["rule_id", 113], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.640653' WHERE "rooler_rules"."id" = 113  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (63))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (63)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.646828' WHERE "rooler_rules"."id" = 113  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 63 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]]  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 113]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."id" IN (63) [["rule_id", 113]]  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:49:11 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 114], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:47:11 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 115], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 116], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 117], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-12"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 118], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 119], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 118 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 119) LIMIT 1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 119], ["deliverable_type", "Rooler::Rule"], ["rule_id", 118], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 118]] Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 119]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (17.1ms) Date: Tue, 18 Mar 2014 12:58:11 +0100 From: from@example.com To: test@email.com Message-ID: <532834d3bdcfd_6a0d3fc44cc35adc997fa@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:58:11.792635' WHERE "rooler_deliveries"."id" = 55 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 55]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 120], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 120]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 120 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 64) LIMIT 1 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", Tue, 18 Mar 2014 11:58:11 UTC +00:00], ["deliverable_id", 64], ["deliverable_type", "Foo"], ["rule_id", 120], ["updated_at", Tue, 18 Mar 2014 11:58:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:11.823652' WHERE "rooler_rules"."id" = 120  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 64]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 121], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 121 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 121) LIMIT 1 SQL (1.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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 121], ["deliverable_type", "Rooler::Rule"], ["rule_id", 121], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 121]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.4ms) Sent mail to test_name@to.com (32.1ms) Date: Tue, 18 Mar 2014 12:58:59 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53283503652b1_6a1c3fd3d6035ae0126b8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 122], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 123], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 124], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 124]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 124 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 66) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 66], ["deliverable_type", "Foo"], ["rule_id", 124], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.525543' WHERE "rooler_rules"."id" = 124  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 124]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (66)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.530526' WHERE "rooler_rules"."id" = 124  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 125], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 126], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 127], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 126 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 69) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 69], ["deliverable_type", "Foo"], ["rule_id", 126], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.581445' WHERE "rooler_rules"."id" = 126 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 127]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 127 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 69) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 69], ["deliverable_type", "Foo"], ["rule_id", 127], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.592201' WHERE "rooler_rules"."id" = 127  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 126]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (69)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 127]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 127]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 127]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 128], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 128 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 71) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 71], ["deliverable_type", "Foo"], ["rule_id", 128], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.631750' WHERE "rooler_rules"."id" = 128  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (71))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (71)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.639406' WHERE "rooler_rules"."id" = 128  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 71 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't'  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (71) [["rule_id", 128]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 61]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 71 [["active", true], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 128]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 128 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 71) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 71], ["deliverable_type", "Foo"], ["rule_id", 128], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.670811' WHERE "rooler_rules"."id" = 128  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:49:59 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 129], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:47:59 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 130], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 131], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 132], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 133], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 134], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 133 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 134) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 134], ["deliverable_type", "Rooler::Rule"], ["rule_id", 133], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 133]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 134]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (18.9ms) Date: Tue, 18 Mar 2014 12:58:59 +0100 From: from@example.com To: test@email.com Message-ID: <53283503bb357_6a1c3fd3d6035ae01274e@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:58:59.783612' WHERE "rooler_deliveries"."id" = 63 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 63]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 135], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 135]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 135 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 72) LIMIT 1 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", Tue, 18 Mar 2014 11:58:59 UTC +00:00], ["deliverable_id", 72], ["deliverable_type", "Foo"], ["rule_id", 135], ["updated_at", Tue, 18 Mar 2014 11:58:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:58:59.816310' WHERE "rooler_rules"."id" = 135  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 72]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 136], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 136 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 136) LIMIT 1 SQL (2.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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 136], ["deliverable_type", "Rooler::Rule"], ["rule_id", 136], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 136]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (41.3ms) Sent mail to test_name@to.com (23.3ms) Date: Tue, 18 Mar 2014 12:59:10 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328350e43896_6a223ffb28435ae0477b2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 137], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 138], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 139], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 139]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 139 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 74) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 74], ["deliverable_type", "Foo"], ["rule_id", 139], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.369741' WHERE "rooler_rules"."id" = 139  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 139]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (74)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.375372' WHERE "rooler_rules"."id" = 139  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 140], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 141], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 142], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 141]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 141 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 77], ["deliverable_type", "Foo"], ["rule_id", 141], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.420752' WHERE "rooler_rules"."id" = 141 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 142]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 142 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 77], ["deliverable_type", "Foo"], ["rule_id", 142], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.429330' WHERE "rooler_rules"."id" = 142  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 141]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 141]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (77)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 142]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 142]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 142]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 143], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 143 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 79) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 79], ["deliverable_type", "Foo"], ["rule_id", 143], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.461279' WHERE "rooler_rules"."id" = 143  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (79))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (79)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.467622' WHERE "rooler_rules"."id" = 143  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 79 [["active", false], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (79) [["rule_id", 143]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 69]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 79 [["active", true], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 143 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 79) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 79], ["deliverable_type", "Foo"], ["rule_id", 143], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.494885' WHERE "rooler_rules"."id" = 143  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:50:10 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 144], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:48:10 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 145], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 146], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 147], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 148], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 149], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 148 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Rooler::Rule"], ["rule_id", 148], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 148]] 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", 149]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.6ms) Date: Tue, 18 Mar 2014 12:59:10 +0100 From: from@example.com To: test@email.com Message-ID: <5328350e8c8fc_6a223ffb28435ae047828@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 11:59:10.587182' WHERE "rooler_deliveries"."id" = 71 Rooler::Delivery Load (1.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 71]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 150], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 150]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 150 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 80) LIMIT 1 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", Tue, 18 Mar 2014 11:59:10 UTC +00:00], ["deliverable_id", 80], ["deliverable_type", "Foo"], ["rule_id", 150], ["updated_at", Tue, 18 Mar 2014 11:59:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 11:59:10.615429' WHERE "rooler_rules"."id" = 150  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 80]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 151], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 151 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Rooler::Rule"], ["rule_id", 151], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 151]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.1ms) Sent mail to test_name@to.com (23.4ms) Date: Tue, 18 Mar 2014 13:05:08 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53283674b58bf_6a703ffac9435ae0958a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 152], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 153], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-3"], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 154], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 154]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 154 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 82) LIMIT 1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["deliverable_id", 82], ["deliverable_type", "Foo"], ["rule_id", 154], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.836046' WHERE "rooler_rules"."id" = 154  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 154]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (82)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.841466' WHERE "rooler_rules"."id" = 154  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 155], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 156], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 157], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 156]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 156 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 85) LIMIT 1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["deliverable_id", 85], ["deliverable_type", "Foo"], ["rule_id", 156], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.890455' WHERE "rooler_rules"."id" = 156 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 157]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 157 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 85) LIMIT 1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["deliverable_id", 85], ["deliverable_type", "Foo"], ["rule_id", 157], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.898927' WHERE "rooler_rules"."id" = 157  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 156]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 156]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (85)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 157]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 157]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 157]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 158], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 158 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 87) LIMIT 1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["deliverable_id", 87], ["deliverable_type", "Foo"], ["rule_id", 158], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.932331' WHERE "rooler_rules"."id" = 158  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (87))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (87)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.938906' WHERE "rooler_rules"."id" = 158  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 87 [["active", false], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (87) [["rule_id", 158]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 77]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 87 [["active", true], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 158]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 158 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 87) LIMIT 1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["deliverable_id", 87], ["deliverable_type", "Foo"], ["rule_id", 158], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:08.967438' WHERE "rooler_rules"."id" = 158  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:56:08 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 159], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:54:08 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 160], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 161], ["updated_at", Tue, 18 Mar 2014 12:05:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 162], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 163], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 164], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 163 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 164) LIMIT 1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["deliverable_id", 164], ["deliverable_type", "Rooler::Rule"], ["rule_id", 163], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 163]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 164]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.0ms) Date: Tue, 18 Mar 2014 13:05:09 +0100 From: from@example.com To: test@email.com Message-ID: <53283675d3c3_6a703ffac9435ae096a2@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 12:05:09.065639' WHERE "rooler_deliveries"."id" = 79 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 79]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 165], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 165]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 165 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 88) LIMIT 1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["deliverable_id", 88], ["deliverable_type", "Foo"], ["rule_id", 165], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:09.090774' WHERE "rooler_rules"."id" = 165  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 88]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 166], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 166]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 166 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1 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", Tue, 18 Mar 2014 12:05:09 UTC +00:00], ["deliverable_id", 89], ["deliverable_type", "Foo"], ["rule_id", 166], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:09.152371' WHERE "rooler_rules"."id" = 166  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 89 [["active", false], ["updated_at", Tue, 18 Mar 2014 12:05:09 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (6.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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 167], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 167 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Rooler::Rule"], ["rule_id", 167], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 167]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.2ms) Sent mail to test_name@to.com (29.4ms) Date: Tue, 18 Mar 2014 13:05:46 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328369a5322f_6a793fc755435ad87086c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.8ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 168], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 169], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 170], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 170 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Foo"], ["rule_id", 170], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.435708' WHERE "rooler_rules"."id" = 170  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (91)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.441109' WHERE "rooler_rules"."id" = 170  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 171], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 172], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 173], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 172]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 172 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 94) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 94], ["deliverable_type", "Foo"], ["rule_id", 172], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.486915' WHERE "rooler_rules"."id" = 172 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 173]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 173 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 94) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 94], ["deliverable_type", "Foo"], ["rule_id", 173], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.494563' WHERE "rooler_rules"."id" = 173  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 172]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 172]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (94)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 173]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 173]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 173]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 174], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 174 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 96) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 96], ["deliverable_type", "Foo"], ["rule_id", 174], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.526731' WHERE "rooler_rules"."id" = 174  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (96))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (96)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.533102' WHERE "rooler_rules"."id" = 174  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 96 [["active", false], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (96) [["rule_id", 174]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 86]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 96 [["active", true], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 174]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 174 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 96) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 96], ["deliverable_type", "Foo"], ["rule_id", 174], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.558091' WHERE "rooler_rules"."id" = 174  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:56:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 175], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:54:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 176], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 177], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 178], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 179], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 180], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 179 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 180) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 180], ["deliverable_type", "Rooler::Rule"], ["rule_id", 179], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 179]] 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", 180]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.9ms) Date: Tue, 18 Mar 2014 13:05:46 +0100 From: from@example.com To: test@email.com Message-ID: <5328369a9b858_6a793fc755435ad870915@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 12:05:46.648243' WHERE "rooler_deliveries"."id" = 88 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 88]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 181], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 181]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 181 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 97) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 97], ["deliverable_type", "Foo"], ["rule_id", 181], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.675432' WHERE "rooler_rules"."id" = 181  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 97]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 182], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 182]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 182 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 98) LIMIT 1 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", Tue, 18 Mar 2014 12:05:46 UTC +00:00], ["deliverable_id", 98], ["deliverable_type", "Foo"], ["rule_id", 182], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:46.736079' WHERE "rooler_rules"."id" = 182  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 98 [["active", false], ["updated_at", Tue, 18 Mar 2014 12:05:46 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Tue, 18 Mar 2014 12:05:57 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 12:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 183], ["updated_at", Tue, 18 Mar 2014 12:05:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 183 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 SQL (2.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", Tue, 18 Mar 2014 12:05:57 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Rooler::Rule"], ["rule_id", 183], ["updated_at", Tue, 18 Mar 2014 12:05:57 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 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", 183]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.8ms) Sent mail to test_name@to.com (24.4ms) Date: Tue, 18 Mar 2014 13:05:58 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532836a6142b4_6a823fcf85035ae075516@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 184], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 185], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 186], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 186]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 186 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 100) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 100], ["deliverable_type", "Foo"], ["rule_id", 186], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.172890' WHERE "rooler_rules"."id" = 186  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 186]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (100)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.178574' WHERE "rooler_rules"."id" = 186  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 187], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 188], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 189], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 188 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 103], ["deliverable_type", "Foo"], ["rule_id", 188], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.228060' WHERE "rooler_rules"."id" = 188 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 189]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 189 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 103], ["deliverable_type", "Foo"], ["rule_id", 189], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.235983' WHERE "rooler_rules"."id" = 189  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 188]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (103)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 189]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 189]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 189]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 190], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 190 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 105) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 105], ["deliverable_type", "Foo"], ["rule_id", 190], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.272246' WHERE "rooler_rules"."id" = 190  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (105))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (105)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.278171' WHERE "rooler_rules"."id" = 190  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 105 [["active", false], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (105) [["rule_id", 190]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 95]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 105 [["active", true], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 190]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 190 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 105) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 105], ["deliverable_type", "Foo"], ["rule_id", 190], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.304955' WHERE "rooler_rules"."id" = 190  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:56:58 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 191], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 11:54:58 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 192], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 193], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 194], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 195], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 196], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 195 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 196) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 196], ["deliverable_type", "Rooler::Rule"], ["rule_id", 195], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 195]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 196]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.7ms) Date: Tue, 18 Mar 2014 13:05:58 +0100 From: from@example.com To: test@email.com Message-ID: <532836a65dc6a_6a823fcf85035ae07568f@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 12:05:58.395243' WHERE "rooler_deliveries"."id" = 97 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 97]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 197], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 197]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 197 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 106) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 106], ["deliverable_type", "Foo"], ["rule_id", 197], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.422167' WHERE "rooler_rules"."id" = 197  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 106]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 198], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 198]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 198 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 107) LIMIT 1 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", Tue, 18 Mar 2014 12:05:58 UTC +00:00], ["deliverable_id", 107], ["deliverable_type", "Foo"], ["rule_id", 198], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 12:05:58.481034' WHERE "rooler_rules"."id" = 198  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 107 [["active", false], ["updated_at", Tue, 18 Mar 2014 12:05:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 198]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (107) [["rule_id", 198]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 99]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (9.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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 199], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 199 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1 SQL (1.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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Rooler::Rule"], ["rule_id", 199], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 199]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.6ms) Sent mail to test_name@to.com (29.5ms) Date: Tue, 18 Mar 2014 14:22:38 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328489e60a66_6e6d3fe950c35ae0144b1@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (2.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 200], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 201], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 202], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 202]] Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 202 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 109) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 109], ["deliverable_type", "Foo"], ["rule_id", 202], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.503974' WHERE "rooler_rules"."id" = 202  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 202]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (109)) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.509642' WHERE "rooler_rules"."id" = 202  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 203], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 204], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 205], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 204]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 204 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 112) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 112], ["deliverable_type", "Foo"], ["rule_id", 204], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.556576' WHERE "rooler_rules"."id" = 204 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]]  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 205 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 112) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 112], ["deliverable_type", "Foo"], ["rule_id", 205], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.564842' WHERE "rooler_rules"."id" = 205  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 204]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 204]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (112)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 205]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 206], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 114) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 114], ["deliverable_type", "Foo"], ["rule_id", 206], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.597445' WHERE "rooler_rules"."id" = 206  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (114))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (114)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.603498' WHERE "rooler_rules"."id" = 206  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 114 [["active", false], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (114) [["rule_id", 206]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 104]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 114 [["active", true], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 114) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 114], ["deliverable_type", "Foo"], ["rule_id", 206], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.628316' WHERE "rooler_rules"."id" = 206  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 13:13:38 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 207], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 13:11:38 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 208], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 209], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 210], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-12"], ["template_id", 211], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 212], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 211 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 212) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 212], ["deliverable_type", "Rooler::Rule"], ["rule_id", 211], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 211]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 212]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.7ms) Date: Tue, 18 Mar 2014 14:22:38 +0100 From: from@example.com To: test@email.com Message-ID: <5328489ead36f_6e6d3fe950c35ae014563@Yonahs-MacBook-Pro.local.mail> Subject: subject-12 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-12 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 13:22:38.720559' WHERE "rooler_deliveries"."id" = 106 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 106]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 213], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 213]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 213 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 115) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 115], ["deliverable_type", "Foo"], ["rule_id", 213], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.746371' WHERE "rooler_rules"."id" = 213  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 115]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 214], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 214 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 116) LIMIT 1 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", Tue, 18 Mar 2014 13:22:38 UTC +00:00], ["deliverable_id", 116], ["deliverable_type", "Foo"], ["rule_id", 214], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 13:22:38.805996' WHERE "rooler_rules"."id" = 214  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 116 [["active", false], ["updated_at", Tue, 18 Mar 2014 13:22:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 214]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (116) [["rule_id", 214]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 108]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (28.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 215], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 215 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 215) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["deliverable_id", 215], ["deliverable_type", "Rooler::Rule"], ["rule_id", 215], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 215]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (50.7ms) Sent mail to test_name@to.com (26.8ms) Date: Tue, 18 Mar 2014 17:20:02 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53287232dbe86_77b53fc501c35ae059439@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 216], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 217], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 218], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 218]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 218 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 118) LIMIT 1 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", Tue, 18 Mar 2014 16:20:02 UTC +00:00], ["deliverable_id", 118], ["deliverable_type", "Foo"], ["rule_id", 218], ["updated_at", Tue, 18 Mar 2014 16:20:02 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:02.995127' WHERE "rooler_rules"."id" = 218  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 218]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (118)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.000384' WHERE "rooler_rules"."id" = 218  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 219], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 220], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 221], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 220 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 121) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 121], ["deliverable_type", "Foo"], ["rule_id", 220], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.047462' WHERE "rooler_rules"."id" = 220 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 221]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 221 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 121) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 121], ["deliverable_type", "Foo"], ["rule_id", 221], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.057932' WHERE "rooler_rules"."id" = 221  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 220]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (121)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 221]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 221]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 221]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 222], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 222 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 123) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 123], ["deliverable_type", "Foo"], ["rule_id", 222], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.090715' WHERE "rooler_rules"."id" = 222  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (123))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (123)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.098055' WHERE "rooler_rules"."id" = 222  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 123 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (123) [["rule_id", 222]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 113]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 123 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 222 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 123) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 123], ["deliverable_type", "Foo"], ["rule_id", 222], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.125779' WHERE "rooler_rules"."id" = 222  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:11:03 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 223], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:09:03 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 224], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 225], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 226], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Invalid"], ["method_params", nil], ["name", "rule-12"], ["template_id", 227], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 228], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 229], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 228 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 229) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 229], ["deliverable_type", "Rooler::Rule"], ["rule_id", 228], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 228]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 229]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (14.3ms) Date: Tue, 18 Mar 2014 17:20:03 +0100 From: from@example.com To: test@email.com Message-ID: <5328723336bcb_77b53fc501c35ae0595a@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:20:03.236075' WHERE "rooler_deliveries"."id" = 115 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 115]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 230], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 230]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 230 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 124) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 124], ["deliverable_type", "Foo"], ["rule_id", 230], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.263312' WHERE "rooler_rules"."id" = 230  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 124]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 231], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 231 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 125) LIMIT 1 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", Tue, 18 Mar 2014 16:20:03 UTC +00:00], ["deliverable_id", 125], ["deliverable_type", "Foo"], ["rule_id", 231], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:20:03.330977' WHERE "rooler_rules"."id" = 231  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 125 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:20:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 231]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (125) [["rule_id", 231]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 117]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 232], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 232 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 232) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 232], ["deliverable_type", "Rooler::Rule"], ["rule_id", 232], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 232]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.4ms) Sent mail to test_name@to.com (28.7ms) Date: Tue, 18 Mar 2014 17:22:20 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532872bc691d0_77d13fcc7e035ae0900c8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 233], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 234], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 235], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 235]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 235 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Foo"], ["rule_id", 235], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.526501' WHERE "rooler_rules"."id" = 235  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 235]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (127)) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.531852' WHERE "rooler_rules"."id" = 235  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 236], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 237], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 238], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 237]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 237 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 130) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 130], ["deliverable_type", "Foo"], ["rule_id", 237], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.579006' WHERE "rooler_rules"."id" = 237 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 238 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 130) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 130], ["deliverable_type", "Foo"], ["rule_id", 238], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.587373' WHERE "rooler_rules"."id" = 238  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 237]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 237]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (130)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 238]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 239], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 239 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 132) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 132], ["deliverable_type", "Foo"], ["rule_id", 239], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.620436' WHERE "rooler_rules"."id" = 239  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (132))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (132)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.626342' WHERE "rooler_rules"."id" = 239  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 132 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (132) [["rule_id", 239]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 122]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 132 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 239]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 239 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 132) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 132], ["deliverable_type", "Foo"], ["rule_id", 239], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.654098' WHERE "rooler_rules"."id" = 239  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:13:20 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 240], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:11:20 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 241], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 242], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 243], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 245], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 246], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 244 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 245) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 245], ["deliverable_type", "Rooler::Rule"], ["rule_id", 244], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 244]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 245]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.2ms) Date: Tue, 18 Mar 2014 17:22:20 +0100 From: from@example.com To: test@email.com Message-ID: <532872bcb6940_77d13fcc7e035ae090117@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:22:20.759536' WHERE "rooler_deliveries"."id" = 124 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 124]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 247], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 246]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 246 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 133) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 133], ["deliverable_type", "Foo"], ["rule_id", 246], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.788056' WHERE "rooler_rules"."id" = 246  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 133]]  (0.6ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 248], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 247]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 247 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 134) LIMIT 1 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", Tue, 18 Mar 2014 16:22:20 UTC +00:00], ["deliverable_id", 134], ["deliverable_type", "Foo"], ["rule_id", 247], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:22:20.852042' WHERE "rooler_rules"."id" = 247  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 134 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:22:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 247]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (134) [["rule_id", 247]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 126]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 16:23:12 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:23:12 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:23:13 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:23:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Tue, 18 Mar 2014 16:24:35 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:24:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 260], ["updated_at", Tue, 18 Mar 2014 16:24:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 248 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 248) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:35 UTC +00:00], ["deliverable_id", 248], ["deliverable_type", "Rooler::Rule"], ["rule_id", 248], ["updated_at", Tue, 18 Mar 2014 16:24:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 248]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.4ms) Sent mail to test_name@to.com (24.0ms) Date: Tue, 18 Mar 2014 17:24:36 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532873441dc88_77f53ff2ba035ad838841@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 261], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 262], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 263], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 251]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 251 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 144) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 144], ["deliverable_type", "Foo"], ["rule_id", 251], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.211990' WHERE "rooler_rules"."id" = 251  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 251]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (144)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.217149' WHERE "rooler_rules"."id" = 251  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 264], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 265], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 266], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 253]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 253 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 147) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 147], ["deliverable_type", "Foo"], ["rule_id", 253], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.263312' WHERE "rooler_rules"."id" = 253 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 254]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 254 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 147) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 147], ["deliverable_type", "Foo"], ["rule_id", 254], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.271103' WHERE "rooler_rules"."id" = 254  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 253]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 253]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (147)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 254]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 254]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 254]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 267], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 255 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 255], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.303874' WHERE "rooler_rules"."id" = 255  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (149))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (149)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.310698' WHERE "rooler_rules"."id" = 255  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 149 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (149) [["rule_id", 255]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 131]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 149 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 255]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 255 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 255], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.336670' WHERE "rooler_rules"."id" = 255  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:15:36 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 268], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:13:36 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 269], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 270], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 271], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 273], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 274], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 260 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 261) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 261], ["deliverable_type", "Rooler::Rule"], ["rule_id", 260], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 260]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 261]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.0ms) Date: Tue, 18 Mar 2014 17:24:36 +0100 From: from@example.com To: test@email.com Message-ID: <532873446898e_77f53ff2ba035ad83895d@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:24:36.439837' WHERE "rooler_deliveries"."id" = 133 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 133]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 275], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 262]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 262 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 150) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 150], ["deliverable_type", "Foo"], ["rule_id", 262], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.468167' WHERE "rooler_rules"."id" = 262  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 150]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 276], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 263]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 263 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1 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", Tue, 18 Mar 2014 16:24:36 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Foo"], ["rule_id", 263], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:24:36.535684' WHERE "rooler_rules"."id" = 263  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 151 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:24:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 263]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (151) [["rule_id", 263]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 135]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 277], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 264 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 264) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["deliverable_id", 264], ["deliverable_type", "Rooler::Rule"], ["rule_id", 264], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 264]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.2ms) Sent mail to test_name@to.com (29.8ms) Date: Tue, 18 Mar 2014 17:25:13 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53287369bb9de_78053fccddc35ad41207c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 278], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 279], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 280], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 267]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 267 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 153) LIMIT 1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["deliverable_id", 153], ["deliverable_type", "Foo"], ["rule_id", 267], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.856367' WHERE "rooler_rules"."id" = 267  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 267]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (153)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.861367' WHERE "rooler_rules"."id" = 267  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 281], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 282], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 283], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 269 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 156) LIMIT 1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["deliverable_id", 156], ["deliverable_type", "Foo"], ["rule_id", 269], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.907478' WHERE "rooler_rules"."id" = 269 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 270 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 156) LIMIT 1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["deliverable_id", 156], ["deliverable_type", "Foo"], ["rule_id", 270], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.915389' WHERE "rooler_rules"."id" = 270  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 269]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (156)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 270]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 284], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 271 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Foo"], ["rule_id", 271], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.946985' WHERE "rooler_rules"."id" = 271  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (158))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (158)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.952723' WHERE "rooler_rules"."id" = 271  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 158 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (158) [["rule_id", 271]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 140]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 158 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 271]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 271 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Foo"], ["rule_id", 271], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:13.979373' WHERE "rooler_rules"."id" = 271  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:16:13 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 285], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:13 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:14:13 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 286], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 287], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 288], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 291], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 292], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 276 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 277) LIMIT 1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["deliverable_id", 277], ["deliverable_type", "Rooler::Rule"], ["rule_id", 276], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 276]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 277]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (16.3ms) Date: Tue, 18 Mar 2014 17:25:14 +0100 From: from@example.com To: test@email.com Message-ID: <5328736a1a240_78053fccddc35ad4121a1@Yonahs-MacBook-Pro.local.mail> Subject: subject-14 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-14 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:25:14.121756' WHERE "rooler_deliveries"."id" = 142 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 142]]  (0.3ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 293], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 159) LIMIT 1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["deliverable_id", 159], ["deliverable_type", "Foo"], ["rule_id", 278], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:14.185657' WHERE "rooler_rules"."id" = 278  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 159]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 294], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 279]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 279 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 160) LIMIT 1 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", Tue, 18 Mar 2014 16:25:14 UTC +00:00], ["deliverable_id", 160], ["deliverable_type", "Foo"], ["rule_id", 279], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:14.215839' WHERE "rooler_rules"."id" = 279  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 160 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:25:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 279]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (160) [["rule_id", 279]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 144]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 295], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 280 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 280) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 280], ["deliverable_type", "Rooler::Rule"], ["rule_id", 280], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 280]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (50.4ms) Sent mail to test_name@to.com (25.7ms) Date: Tue, 18 Mar 2014 17:25:46 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5328738a699a2_780e3ff9de035ad052f6@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 296], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 297], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 298], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 283]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 283 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 162) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 162], ["deliverable_type", "Foo"], ["rule_id", 283], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.519822' WHERE "rooler_rules"."id" = 283  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 283]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (162)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.525121' WHERE "rooler_rules"."id" = 283  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 299], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 300], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 301], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 285 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 165) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 165], ["deliverable_type", "Foo"], ["rule_id", 285], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.571929' WHERE "rooler_rules"."id" = 285 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 286]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 286 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 165) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 165], ["deliverable_type", "Foo"], ["rule_id", 286], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.579757' WHERE "rooler_rules"."id" = 286  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 285]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 285]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (165)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 286]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 286]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 286]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 302], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 287 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Foo"], ["rule_id", 287], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.611750' WHERE "rooler_rules"."id" = 287  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (167))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (167)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.618803' WHERE "rooler_rules"."id" = 287  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 167 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (167) [["rule_id", 287]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 149]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 167 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 287 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Foo"], ["rule_id", 287], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.645547' WHERE "rooler_rules"."id" = 287  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:16:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 303], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:14:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 304], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 305], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 306], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 308], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 309], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 292 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 293) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 293], ["deliverable_type", "Rooler::Rule"], ["rule_id", 292], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 292]] 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", 293]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.1ms) Date: Tue, 18 Mar 2014 17:25:46 +0100 From: from@example.com To: test@email.com Message-ID: <5328738ab427f_780e3ff9de035ad0535b@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:25:46.749288' WHERE "rooler_deliveries"."id" = 151 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 151]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 310], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 294]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 294 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 168) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 168], ["deliverable_type", "Foo"], ["rule_id", 294], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.773975' WHERE "rooler_rules"."id" = 294  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 168]]  (0.6ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 311], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 295 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 169) LIMIT 1 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", Tue, 18 Mar 2014 16:25:46 UTC +00:00], ["deliverable_id", 169], ["deliverable_type", "Foo"], ["rule_id", 295], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:25:46.838679' WHERE "rooler_rules"."id" = 295  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 169 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:25:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (169) [["rule_id", 295]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 153]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (8.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 16:27:10 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:27:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 312], ["updated_at", Tue, 18 Mar 2014 16:27:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 296 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 296) LIMIT 1 SQL (1.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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 296], ["deliverable_type", "Rooler::Rule"], ["rule_id", 296], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 296]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (47.3ms) Sent mail to test_name@to.com (29.7ms) Date: Tue, 18 Mar 2014 17:27:11 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532873df2cbbf_78223fda8d035adc117a8@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 313], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 314], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 315], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 299 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 171) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 171], ["deliverable_type", "Foo"], ["rule_id", 299], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.270120' WHERE "rooler_rules"."id" = 299  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 299]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (171)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.275801' WHERE "rooler_rules"."id" = 299  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 316], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 317], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 318], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 301]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 301 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 174) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 174], ["deliverable_type", "Foo"], ["rule_id", 301], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.323083' WHERE "rooler_rules"."id" = 301 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 302]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 302 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 174) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 174], ["deliverable_type", "Foo"], ["rule_id", 302], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.331013' WHERE "rooler_rules"."id" = 302  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 301]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 301]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (174)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 302]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 302]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 302]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 319], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 303 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 176) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 176], ["deliverable_type", "Foo"], ["rule_id", 303], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.365627' WHERE "rooler_rules"."id" = 303  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (176))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (176)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.371820' WHERE "rooler_rules"."id" = 303  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 176 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (176) [["rule_id", 303]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 158]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 176 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 303]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 303 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 176) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 176], ["deliverable_type", "Foo"], ["rule_id", 303], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.399175' WHERE "rooler_rules"."id" = 303  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:18:11 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 320], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:16:11 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 321], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 322], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 323], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 325], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 326], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 308 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 309) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 309], ["deliverable_type", "Rooler::Rule"], ["rule_id", 308], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 308]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 309]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.1ms) Date: Tue, 18 Mar 2014 17:27:11 +0100 From: from@example.com To: test@email.com Message-ID: <532873df78bae_78223fda8d035adc118ef@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:27:11.505838' WHERE "rooler_deliveries"."id" = 160 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 160]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 327], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 310]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 310 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 177) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 177], ["deliverable_type", "Foo"], ["rule_id", 310], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.532698' WHERE "rooler_rules"."id" = 310  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 177]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 328], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 311]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 311 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 178) LIMIT 1 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", Tue, 18 Mar 2014 16:27:11 UTC +00:00], ["deliverable_id", 178], ["deliverable_type", "Foo"], ["rule_id", 311], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:11.596730' WHERE "rooler_rules"."id" = 311  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 178 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:27:11 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 311]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (178) [["rule_id", 311]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 162]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 329], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 312 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 312) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 312], ["deliverable_type", "Rooler::Rule"], ["rule_id", 312], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 312]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.1ms) Sent mail to test_name@to.com (33.9ms) Date: Tue, 18 Mar 2014 17:27:51 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532874075d7fd_782b3fed0a035ad4892a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 330], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 331], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 332], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 315]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 315 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 180) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 180], ["deliverable_type", "Foo"], ["rule_id", 315], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.478781' WHERE "rooler_rules"."id" = 315  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 315]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (180)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.483673' WHERE "rooler_rules"."id" = 315  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 333], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 334], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 335], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 317]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 317 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Foo"], ["rule_id", 317], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.530107' WHERE "rooler_rules"."id" = 317 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 318]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 318 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 183) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 183], ["deliverable_type", "Foo"], ["rule_id", 318], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.537838' WHERE "rooler_rules"."id" = 318  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 317]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 317]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (183)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 318]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 318]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 318]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 336], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 319 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 319], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.569107' WHERE "rooler_rules"."id" = 319  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (185))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (185)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.574820' WHERE "rooler_rules"."id" = 319  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 185 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (185) [["rule_id", 319]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 167]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 185 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 319]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 319 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 319], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.601580' WHERE "rooler_rules"."id" = 319  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:18:51 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 337], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:16:51 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 338], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 339], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 340], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.4ms) SELECT COUNT(*) FROM "rooler_rules"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-13"], ["template_id", 342], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 343], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 324 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 325) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 325], ["deliverable_type", "Rooler::Rule"], ["rule_id", 324], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 324]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 325]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.7ms) Date: Tue, 18 Mar 2014 17:27:51 +0100 From: from@example.com To: test@email.com Message-ID: <53287407a9136_782b3fed0a035ad490b1@Yonahs-MacBook-Pro.local.mail> Subject: subject-13 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-13 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:27:51.703632' WHERE "rooler_deliveries"."id" = 169 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 169]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 344], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 326]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 326 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 186) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 186], ["deliverable_type", "Foo"], ["rule_id", 326], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.731741' WHERE "rooler_rules"."id" = 326  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 186]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 345], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 327 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 187) LIMIT 1 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", Tue, 18 Mar 2014 16:27:51 UTC +00:00], ["deliverable_id", 187], ["deliverable_type", "Foo"], ["rule_id", 327], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:27:51.799643' WHERE "rooler_rules"."id" = 327  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 187 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:27:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 327]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (187) [["rule_id", 327]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 171]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.9ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (11.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Tue, 18 Mar 2014 16:30:54 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Tue, 18 Mar 2014 16:30:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 346], ["updated_at", Tue, 18 Mar 2014 16:30:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 328 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 328) LIMIT 1 SQL (1.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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 328], ["deliverable_type", "Rooler::Rule"], ["rule_id", 328], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 328]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (51.9ms) Sent mail to test_name@to.com (35.8ms) Date: Tue, 18 Mar 2014 17:30:55 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532874bf2bd93_785d3fe2ad435ad8613ca@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 347], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 348], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-3"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 349], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 331 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 189) LIMIT 1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 189], ["deliverable_type", "Foo"], ["rule_id", 331], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.300794' WHERE "rooler_rules"."id" = 331  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (189)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.307913' WHERE "rooler_rules"."id" = 331  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 350], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 351], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 352], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 333]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 333 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 192) LIMIT 1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 192], ["deliverable_type", "Foo"], ["rule_id", 333], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.372032' WHERE "rooler_rules"."id" = 333 Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 334]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 334 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 192) LIMIT 1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 192], ["deliverable_type", "Foo"], ["rule_id", 334], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.382454' WHERE "rooler_rules"."id" = 334  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 333]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 333]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (192)) Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 334]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 334]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 334]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 353], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 335 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 194) LIMIT 1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 194], ["deliverable_type", "Foo"], ["rule_id", 335], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.426030' WHERE "rooler_rules"."id" = 335  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (194))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (194)) SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.434532' WHERE "rooler_rules"."id" = 335  (1.1ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 194 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (194) [["rule_id", 335]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 176]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 194 [["active", true], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 335]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 335 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 194) LIMIT 1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 194], ["deliverable_type", "Foo"], ["rule_id", 335], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.470161' WHERE "rooler_rules"."id" = 335  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:21:55 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 354], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Tue, 18 Mar 2014 16:19:55 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 355], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-10"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 356], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 357], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.6ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 360], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 361], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 340 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 341) LIMIT 1 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 341], ["deliverable_type", "Rooler::Rule"], ["rule_id", 340], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 340]] Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 341]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (24.9ms) Date: Tue, 18 Mar 2014 17:30:55 +0100 From: from@example.com To: test@email.com Message-ID: <532874bfa2e06_785d3fe2ad435ad86146f@Yonahs-MacBook-Pro.local.mail> Subject: subject-14 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-14 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-18 16:30:55.688653' WHERE "rooler_deliveries"."id" = 178 Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 178]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 362], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]] Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 342 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 195) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 195], ["deliverable_type", "Foo"], ["rule_id", 342], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.786873' WHERE "rooler_rules"."id" = 342  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 195]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 363], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 343]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 343 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 196) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00], ["deliverable_id", 196], ["deliverable_type", "Foo"], ["rule_id", 343], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-18 16:30:55.837651' WHERE "rooler_rules"."id" = 343  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 196 [["active", false], ["updated_at", Tue, 18 Mar 2014 16:30:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 343]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (196) [["rule_id", 343]]  (0.4ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 180]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (56.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (28.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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 364], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (43.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 344 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 344) LIMIT 1 SQL (30.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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["deliverable_id", 344], ["deliverable_type", "Rooler::Rule"], ["rule_id", 344], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 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", 344]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (50.5ms) Sent mail to test_name@to.com (54.0ms) Date: Wed, 19 Mar 2014 18:15:28 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5329d0b0cb22a_15f33ff794c35ad497980@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (9.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 365], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 366], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 367], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 347]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 347 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 198) LIMIT 1 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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["deliverable_id", 198], ["deliverable_type", "Foo"], ["rule_id", 347], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:28.950408' WHERE "rooler_rules"."id" = 347  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 347]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (198)) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:28.955880' WHERE "rooler_rules"."id" = 347  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 368], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 369], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 370], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 349 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 201) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 201], ["deliverable_type", "Foo"], ["rule_id", 349], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.025109' WHERE "rooler_rules"."id" = 349 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 350 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 201) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 201], ["deliverable_type", "Foo"], ["rule_id", 350], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.033245' WHERE "rooler_rules"."id" = 350  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 349]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (201)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 350]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 371], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 351 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 203) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 203], ["deliverable_type", "Foo"], ["rule_id", 351], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.068627' WHERE "rooler_rules"."id" = 351  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (203))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (203)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.074753' WHERE "rooler_rules"."id" = 351  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 203 [["active", false], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (203) [["rule_id", 351]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 185]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 203 [["active", true], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 351]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 351 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 203) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 203], ["deliverable_type", "Foo"], ["rule_id", 351], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.102120' WHERE "rooler_rules"."id" = 351  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Wed, 19 Mar 2014 17:06:29 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 372], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Wed, 19 Mar 2014 17:04:29 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 373], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 374], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 375], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (25.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())  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 378], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 379], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 356 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 357) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 357], ["deliverable_type", "Rooler::Rule"], ["rule_id", 356], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 356]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 357]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.5ms) Date: Wed, 19 Mar 2014 18:15:29 +0100 From: from@example.com To: test@email.com Message-ID: <5329d0b143a58_15f33ff794c35ad49807f@Yonahs-MacBook-Pro.local.mail> Subject: subject-14 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-14 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-19 17:15:29.288954' WHERE "rooler_deliveries"."id" = 187 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 187]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 380], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 358]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 358 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 204) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 204], ["deliverable_type", "Foo"], ["rule_id", 358], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.356943' WHERE "rooler_rules"."id" = 358  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 204]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 381], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 359]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 359 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 205) LIMIT 1 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", Wed, 19 Mar 2014 17:15:29 UTC +00:00], ["deliverable_id", 205], ["deliverable_type", "Foo"], ["rule_id", 359], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-19 17:15:29.386408' WHERE "rooler_rules"."id" = 359  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 205 [["active", false], ["updated_at", Wed, 19 Mar 2014 17:15:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (53.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 359]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (205) [["rule_id", 359]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 189]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (32.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:38:13 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:38:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 382], ["updated_at", Thu, 20 Mar 2014 14:38:13 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 360 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 360) LIMIT 1 SQL (1.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", Thu, 20 Mar 2014 14:38:13 UTC +00:00], ["deliverable_id", 360], ["deliverable_type", "Rooler::Rule"], ["rule_id", 360], ["updated_at", Thu, 20 Mar 2014 14:38:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.4ms) 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", 360]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (51.7ms) Sent mail to test_name@to.com (47.5ms) Date: Thu, 20 Mar 2014 15:38:14 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532afd563064_796a3fecfd835ad432832@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 383], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 384], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 385], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 363]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 363 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 207) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 207], ["deliverable_type", "Foo"], ["rule_id", 363], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.105708' WHERE "rooler_rules"."id" = 363  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 363]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (207)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.110486' WHERE "rooler_rules"."id" = 363  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 386], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 387], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 388], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 365]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 365 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 210) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 210], ["deliverable_type", "Foo"], ["rule_id", 365], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.186610' WHERE "rooler_rules"."id" = 365 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 366 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 210) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 210], ["deliverable_type", "Foo"], ["rule_id", 366], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.196132' WHERE "rooler_rules"."id" = 366  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 365]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 365]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (210)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 366]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 389], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 212) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 212], ["deliverable_type", "Foo"], ["rule_id", 367], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.231082' WHERE "rooler_rules"."id" = 367  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (212))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (212)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.237462' WHERE "rooler_rules"."id" = 367  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 212 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (212) [["rule_id", 367]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 194]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 212 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 212) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 212], ["deliverable_type", "Foo"], ["rule_id", 367], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.263569' WHERE "rooler_rules"."id" = 367  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:29:14 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 390], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-9"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:27:14 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 391], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 392], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 393], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 396], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 397], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 372 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 373) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 373], ["deliverable_type", "Rooler::Rule"], ["rule_id", 372], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 372]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 373]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.5ms) Date: Thu, 20 Mar 2014 15:38:14 +0100 From: from@example.com To: test@email.com Message-ID: <532afd56679a8_796a3fecfd835ad432930@Yonahs-MacBook-Pro.local.mail> Subject: subject-14 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-14 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:38:14.436234' WHERE "rooler_deliveries"."id" = 196 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 196]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 398], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 374]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 374 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 213) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 213], ["deliverable_type", "Foo"], ["rule_id", 374], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.504566' WHERE "rooler_rules"."id" = 374  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 213]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 399], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 375]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (53.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 375 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 214) LIMIT 1 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", Thu, 20 Mar 2014 14:38:14 UTC +00:00], ["deliverable_id", 214], ["deliverable_type", "Foo"], ["rule_id", 375], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:38:14.588880' WHERE "rooler_rules"."id" = 375  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 214 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:38:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 375]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (214) [["rule_id", 375]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 198]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 400], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 376 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 376) LIMIT 1 SQL (1.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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 376], ["deliverable_type", "Rooler::Rule"], ["rule_id", 376], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 376]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.0ms) Sent mail to test_name@to.com (23.3ms) Date: Thu, 20 Mar 2014 15:42:35 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532afe5b4f650_79c13fd38dc35adc81461@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 401], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 402], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 403], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 379]] Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 379 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 216) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 216], ["deliverable_type", "Foo"], ["rule_id", 379], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.413857' WHERE "rooler_rules"."id" = 379  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 379]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (216)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.419250' WHERE "rooler_rules"."id" = 379  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 404], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 405], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 406], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 381 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 219) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 219], ["deliverable_type", "Foo"], ["rule_id", 381], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.467717' WHERE "rooler_rules"."id" = 381 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 382 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 219) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 219], ["deliverable_type", "Foo"], ["rule_id", 382], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.475913' WHERE "rooler_rules"."id" = 382  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 381]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 381]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (219)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 382]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 407], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 383 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Foo"], ["rule_id", 383], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.509288' WHERE "rooler_rules"."id" = 383  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (221))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (221)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.515275' WHERE "rooler_rules"."id" = 383  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 221 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (221) [["rule_id", 383]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 203]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 221 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 383]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 383 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Foo"], ["rule_id", 383], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.541490' WHERE "rooler_rules"."id" = 383  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:33:35 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 408], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:31:35 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 409], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 410], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 411], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 414], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 414]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.7ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 415], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 416], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 389 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 390) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 390], ["deliverable_type", "Rooler::Rule"], ["rule_id", 389], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 389]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 390]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.1ms) Date: Thu, 20 Mar 2014 15:42:35 +0100 From: from@example.com To: test@email.com Message-ID: <532afe5bc54ed_79c13fd38dc35adc815bb@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:42:35.820292' WHERE "rooler_deliveries"."id" = 205 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 205]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 417], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 391]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 391 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 224) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 224], ["deliverable_type", "Foo"], ["rule_id", 391], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.908592' WHERE "rooler_rules"."id" = 391  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 224]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 418], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 392]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 392 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 225) LIMIT 1 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", Thu, 20 Mar 2014 14:42:35 UTC +00:00], ["deliverable_id", 225], ["deliverable_type", "Foo"], ["rule_id", 392], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:42:35.935310' WHERE "rooler_rules"."id" = 392  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 225 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:42:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 392]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (225) [["rule_id", 392]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 207]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 419], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) 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 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 393], ["deliverable_type", "Rooler::Rule"], ["rule_id", 393], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 393]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.4ms) Sent mail to test_name@to.com (28.8ms) Date: Thu, 20 Mar 2014 15:45:30 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532aff0a5c56a_7a2f3fc191035ad870841@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 420], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 421], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 422], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 396 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 227) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 227], ["deliverable_type", "Foo"], ["rule_id", 396], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.467025' WHERE "rooler_rules"."id" = 396  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (227)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.471843' WHERE "rooler_rules"."id" = 396  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 423], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 424], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 425], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 398 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 230) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 230], ["deliverable_type", "Foo"], ["rule_id", 398], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.517729' WHERE "rooler_rules"."id" = 398 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 399 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 230) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 230], ["deliverable_type", "Foo"], ["rule_id", 399], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.526531' WHERE "rooler_rules"."id" = 399  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (230)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 399]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 426], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 400 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 232) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 232], ["deliverable_type", "Foo"], ["rule_id", 400], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.560149' WHERE "rooler_rules"."id" = 400  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (232))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (232)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.566125' WHERE "rooler_rules"."id" = 400  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 232 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (232) [["rule_id", 400]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 212]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 232 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 400 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 232) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 232], ["deliverable_type", "Foo"], ["rule_id", 400], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.591777' WHERE "rooler_rules"."id" = 400  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:36:30 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 427], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-9"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:34:30 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 428], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 429], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 430], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 433], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 433]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.8ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 434], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 435], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 406 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 407) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 407], ["deliverable_type", "Rooler::Rule"], ["rule_id", 406], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 406]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 407]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (14.8ms) Date: Thu, 20 Mar 2014 15:45:30 +0100 From: from@example.com To: test@email.com Message-ID: <532aff0ac243c_7a2f3fc191035ad87095@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:45:30.807838' WHERE "rooler_deliveries"."id" = 214 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 214]]  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 436], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 408]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 408 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Foo"], ["rule_id", 408], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.888736' WHERE "rooler_rules"."id" = 408  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 235]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 437], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 409 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 236) LIMIT 1 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", Thu, 20 Mar 2014 14:45:30 UTC +00:00], ["deliverable_id", 236], ["deliverable_type", "Foo"], ["rule_id", 409], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:45:30.916513' WHERE "rooler_rules"."id" = 409  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 236 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:45:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (236) [["rule_id", 409]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 216]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 438], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 410 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 410) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["deliverable_id", 410], ["deliverable_type", "Rooler::Rule"], ["rule_id", 410], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.0ms) 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", 410]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.4ms) Sent mail to test_name@to.com (22.9ms) Date: Thu, 20 Mar 2014 15:46:20 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532aff3cbed51_7a443fca8d435ad416354@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 439], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 440], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 441], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 413]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 413 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 238) LIMIT 1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["deliverable_id", 238], ["deliverable_type", "Foo"], ["rule_id", 413], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.867684' WHERE "rooler_rules"."id" = 413  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 413]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (238)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.872725' WHERE "rooler_rules"."id" = 413  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 442], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 443], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 444], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 415]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 415 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 241) LIMIT 1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["deliverable_id", 241], ["deliverable_type", "Foo"], ["rule_id", 415], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.918804' WHERE "rooler_rules"."id" = 415 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 416 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 241) LIMIT 1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["deliverable_id", 241], ["deliverable_type", "Foo"], ["rule_id", 416], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.927027' WHERE "rooler_rules"."id" = 416  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 415]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 415]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (241)) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 416]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 445], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 417 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 243) LIMIT 1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["deliverable_id", 243], ["deliverable_type", "Foo"], ["rule_id", 417], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.962080' WHERE "rooler_rules"."id" = 417  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (243))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (243)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.967983' WHERE "rooler_rules"."id" = 417  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 243 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (243) [["rule_id", 417]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 221]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 243 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 417 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 243) LIMIT 1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["deliverable_id", 243], ["deliverable_type", "Foo"], ["rule_id", 417], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:20.994578' WHERE "rooler_rules"."id" = 417  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:20 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:20 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:37:20 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 446], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:35:21 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 447], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 448], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 449], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 452], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 452]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.7ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 453], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 454], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 423 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 424) LIMIT 1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["deliverable_id", 424], ["deliverable_type", "Rooler::Rule"], ["rule_id", 423], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 423]] 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", 424]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.0ms) Date: Thu, 20 Mar 2014 15:46:21 +0100 From: from@example.com To: test@email.com Message-ID: <532aff3d305c3_7a443fca8d435ad416466@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:46:21.210232' WHERE "rooler_deliveries"."id" = 223 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 223]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 455], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 425]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 425 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 246) LIMIT 1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["deliverable_id", 246], ["deliverable_type", "Foo"], ["rule_id", 425], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:21.298974' WHERE "rooler_rules"."id" = 425  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 246]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 456], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 426]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 426 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 247) LIMIT 1 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", Thu, 20 Mar 2014 14:46:21 UTC +00:00], ["deliverable_id", 247], ["deliverable_type", "Foo"], ["rule_id", 426], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:46:21.324449' WHERE "rooler_rules"."id" = 426  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 247 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:46:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 426]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (247) [["rule_id", 426]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 225]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.8ms) 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 457], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 427 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 427) LIMIT 1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["deliverable_id", 427], ["deliverable_type", "Rooler::Rule"], ["rule_id", 427], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 427]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.5ms) Sent mail to test_name@to.com (23.3ms) Date: Thu, 20 Mar 2014 15:47:09 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532aff6dd2488_7a523fc9dc435ae0810e5@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 458], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 459], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 460], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 430]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 430 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 249) LIMIT 1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["deliverable_id", 249], ["deliverable_type", "Foo"], ["rule_id", 430], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:09.951374' WHERE "rooler_rules"."id" = 430  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 430]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (249)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:09.956973' WHERE "rooler_rules"."id" = 430  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 461], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 462], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:09 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 463], ["updated_at", Thu, 20 Mar 2014 14:47:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 432 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 252) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 252], ["deliverable_type", "Foo"], ["rule_id", 432], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.005355' WHERE "rooler_rules"."id" = 432 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 433 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 252) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 252], ["deliverable_type", "Foo"], ["rule_id", 433], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.013152' WHERE "rooler_rules"."id" = 433  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 432]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (252)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 433]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 433]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 464], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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" = 254) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 254], ["deliverable_type", "Foo"], ["rule_id", 434], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.045920' WHERE "rooler_rules"."id" = 434  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (254))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (254)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.052137' WHERE "rooler_rules"."id" = 434  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 254 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (254) [["rule_id", 434]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 230]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 254 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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" = 254) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 254], ["deliverable_type", "Foo"], ["rule_id", 434], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.077245' WHERE "rooler_rules"."id" = 434  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:38:10 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 465], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:36:10 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 466], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 467], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 468], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 471], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 471]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.6ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.7ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 472], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 473], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 440 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 441) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 441], ["deliverable_type", "Rooler::Rule"], ["rule_id", 440], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 440]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 441]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.9ms) Date: Thu, 20 Mar 2014 15:47:10 +0100 From: from@example.com To: test@email.com Message-ID: <532aff6e44f4a_7a523fc9dc435ae0811f4@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:47:10.294608' WHERE "rooler_deliveries"."id" = 232 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 232]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (58.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 474], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 442]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 442 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 257) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 257], ["deliverable_type", "Foo"], ["rule_id", 442], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.379736' WHERE "rooler_rules"."id" = 442  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 257]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-18"], ["created_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 475], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 443]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 443 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 258) LIMIT 1 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", Thu, 20 Mar 2014 14:47:10 UTC +00:00], ["deliverable_id", 258], ["deliverable_type", "Foo"], ["rule_id", 443], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:47:10.405394' WHERE "rooler_rules"."id" = 443  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 258 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:47:10 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 443]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (258) [["rule_id", 443]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 234]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 476], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 444 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 444) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["deliverable_id", 444], ["deliverable_type", "Rooler::Rule"], ["rule_id", 444], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 444]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.3ms) Sent mail to test_name@to.com (28.5ms) Date: Thu, 20 Mar 2014 15:48:08 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532affa8cb0af_7a873fdf8d835ad450215@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 477], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 478], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 479], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 447]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 447 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 260) LIMIT 1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["deliverable_id", 260], ["deliverable_type", "Foo"], ["rule_id", 447], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:08.925245' WHERE "rooler_rules"."id" = 447  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 447]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (260)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:08.930527' WHERE "rooler_rules"."id" = 447  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 480], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 481], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 482], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 449]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 449 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 263) LIMIT 1 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", Thu, 20 Mar 2014 14:48:08 UTC +00:00], ["deliverable_id", 263], ["deliverable_type", "Foo"], ["rule_id", 449], ["updated_at", Thu, 20 Mar 2014 14:48:08 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:08.996069' WHERE "rooler_rules"."id" = 449 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 450 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 263) LIMIT 1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["deliverable_id", 263], ["deliverable_type", "Foo"], ["rule_id", 450], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.008490' WHERE "rooler_rules"."id" = 450  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 449]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 449]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (263)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 450]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.8ms) 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 483], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 451 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 265) LIMIT 1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["deliverable_id", 265], ["deliverable_type", "Foo"], ["rule_id", 451], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.054616' WHERE "rooler_rules"."id" = 451  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (265))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (265)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.063428' WHERE "rooler_rules"."id" = 451  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 265 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (265) [["rule_id", 451]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 239]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 265 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 451]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 451 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 265) LIMIT 1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["deliverable_id", 265], ["deliverable_type", "Foo"], ["rule_id", 451], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.092372' WHERE "rooler_rules"."id" = 451  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:39:09 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 484], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:37:09 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 485], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 486], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 487], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 490], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 490]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (0.7ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 490]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 490]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 491], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 492], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 457 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 458) LIMIT 1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["deliverable_id", 458], ["deliverable_type", "Rooler::Rule"], ["rule_id", 457], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 457]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 458]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (15.4ms) Date: Thu, 20 Mar 2014 15:48:09 +0100 From: from@example.com To: test@email.com Message-ID: <532affa948fbd_7a873fdf8d835ad450336@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:48:09.312001' WHERE "rooler_deliveries"."id" = 241 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 241]]  (0.6ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 493], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 459]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 459 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 268) LIMIT 1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["deliverable_id", 268], ["deliverable_type", "Foo"], ["rule_id", 459], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.394756' WHERE "rooler_rules"."id" = 459  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 268]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 494], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 460]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 460 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 269) LIMIT 1 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", Thu, 20 Mar 2014 14:48:09 UTC +00:00], ["deliverable_id", 269], ["deliverable_type", "Foo"], ["rule_id", 460], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:48:09.420787' WHERE "rooler_rules"."id" = 460  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 269 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:48:09 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 460]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (269) [["rule_id", 460]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 243]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.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", Thu, 20 Mar 2014 14:49:41 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:49:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:41 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 495], ["updated_at", Thu, 20 Mar 2014 14:49:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) 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" = 461) LIMIT 1 SQL (1.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", Thu, 20 Mar 2014 14:49:41 UTC +00:00], ["deliverable_id", 461], ["deliverable_type", "Rooler::Rule"], ["rule_id", 461], ["updated_at", Thu, 20 Mar 2014 14:49:41 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 461]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.9ms) Sent mail to test_name@to.com (23.3ms) Date: Thu, 20 Mar 2014 15:49:42 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b000679d3_7ac73fdaf4835ae091945@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 496], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 497], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 498], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 464 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 271) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 271], ["deliverable_type", "Foo"], ["rule_id", 464], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.124271' WHERE "rooler_rules"."id" = 464  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (271)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.129425' WHERE "rooler_rules"."id" = 464  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 499], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 500], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 501], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 466]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 466 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 274) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 274], ["deliverable_type", "Foo"], ["rule_id", 466], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.177442' WHERE "rooler_rules"."id" = 466 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 467]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 467 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 274) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 274], ["deliverable_type", "Foo"], ["rule_id", 467], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.185265' WHERE "rooler_rules"."id" = 467  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 466]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 466]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (274)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 467]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 467]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 467]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 502], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 468 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 276) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 276], ["deliverable_type", "Foo"], ["rule_id", 468], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.218453' WHERE "rooler_rules"."id" = 468  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (276))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (276)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.224451' WHERE "rooler_rules"."id" = 468  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 276 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (276) [["rule_id", 468]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 248]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 276 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 468 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 276) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 276], ["deliverable_type", "Foo"], ["rule_id", 468], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.251041' WHERE "rooler_rules"."id" = 468  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:40:42 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 503], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:38:42 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 504], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 505], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 506], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 509], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 509]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (0.7ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 509]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 509]] Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 509]] Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 509]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 510], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 511], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 474 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 475) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 475], ["deliverable_type", "Rooler::Rule"], ["rule_id", 474], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 474]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 475]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (70.5ms) Date: Thu, 20 Mar 2014 15:49:42 +0100 From: from@example.com To: test@email.com Message-ID: <532b000673183_7ac73fdaf4835ae0920f2@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:49:42.538927' WHERE "rooler_deliveries"."id" = 250 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 250]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 512], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 476]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 476 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 279) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 279], ["deliverable_type", "Foo"], ["rule_id", 476], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.566825' WHERE "rooler_rules"."id" = 476  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 279]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 513], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 477]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 477 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 280) LIMIT 1 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", Thu, 20 Mar 2014 14:49:42 UTC +00:00], ["deliverable_id", 280], ["deliverable_type", "Foo"], ["rule_id", 477], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:49:42.596497' WHERE "rooler_rules"."id" = 477  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 280 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:49:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 477]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (280) [["rule_id", 477]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 252]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (8.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 514], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 478 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 478) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 478], ["deliverable_type", "Rooler::Rule"], ["rule_id", 478], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.4ms) 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", 478]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.0ms) Sent mail to test_name@to.com (26.1ms) Date: Thu, 20 Mar 2014 15:50:24 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b00306471b_7ad73fd1c5435ae081935@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 515], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 516], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 517], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 481]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 481 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 282) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 282], ["deliverable_type", "Foo"], ["rule_id", 481], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.502746' WHERE "rooler_rules"."id" = 481  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 481]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (282)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.508219' WHERE "rooler_rules"."id" = 481  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 518], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 519], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 520], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 483]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 483 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 285) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 285], ["deliverable_type", "Foo"], ["rule_id", 483], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.555457' WHERE "rooler_rules"."id" = 483 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 484]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 484 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 285) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 285], ["deliverable_type", "Foo"], ["rule_id", 484], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.563386' WHERE "rooler_rules"."id" = 484  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 483]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 483]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (285)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 484]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 484]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 484]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 521], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 485 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 287) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 287], ["deliverable_type", "Foo"], ["rule_id", 485], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.598391' WHERE "rooler_rules"."id" = 485  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (287))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (287)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.604583' WHERE "rooler_rules"."id" = 485  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 287 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (287) [["rule_id", 485]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 257]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 287 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 485]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 485 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 287) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 287], ["deliverable_type", "Foo"], ["rule_id", 485], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.631200' WHERE "rooler_rules"."id" = 485  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:41:24 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 522], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:39:24 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 523], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 524], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 525], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 528], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 528]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 528]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 528]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 529], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 530], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 491 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 492) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 492], ["deliverable_type", "Rooler::Rule"], ["rule_id", 491], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 491]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 492]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.7ms) Date: Thu, 20 Mar 2014 15:50:24 +0100 From: from@example.com To: test@email.com Message-ID: <532b0030c7ccd_7ad73fd1c5435ae0820f8@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:50:24.830309' WHERE "rooler_deliveries"."id" = 259 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 259]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 531], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 493]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 493 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 290) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 290], ["deliverable_type", "Foo"], ["rule_id", 493], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.912972' WHERE "rooler_rules"."id" = 493  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 290]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-18"], ["created_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 532], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 494]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 494 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 291) LIMIT 1 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", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["deliverable_id", 291], ["deliverable_type", "Foo"], ["rule_id", 494], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:24.937783' WHERE "rooler_rules"."id" = 494  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 291 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 494]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (291) [["rule_id", 494]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 261]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (11.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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 533], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 495 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 495) LIMIT 1 SQL (1.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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 495], ["deliverable_type", "Rooler::Rule"], ["rule_id", 495], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 495]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (64.3ms) Sent mail to test_name@to.com (39.5ms) Date: Thu, 20 Mar 2014 15:50:45 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b004573fda_7ade3fdd99835ad4528e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 534], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 535], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 536], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 498]] Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 498 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 293) LIMIT 1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 293], ["deliverable_type", "Foo"], ["rule_id", 498], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.597923' WHERE "rooler_rules"."id" = 498  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 498]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (293)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.604622' WHERE "rooler_rules"."id" = 498  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-4"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 537], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 538], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 539], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 500 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 296) LIMIT 1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 296], ["deliverable_type", "Foo"], ["rule_id", 500], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.671087' WHERE "rooler_rules"."id" = 500 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 501]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 501 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 296) LIMIT 1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 296], ["deliverable_type", "Foo"], ["rule_id", 501], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.682289' WHERE "rooler_rules"."id" = 501  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 500]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (296)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 501]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 501]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 501]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 540], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 502 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 298) LIMIT 1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 298], ["deliverable_type", "Foo"], ["rule_id", 502], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.725751' WHERE "rooler_rules"."id" = 502  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (298))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (298)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.732165' WHERE "rooler_rules"."id" = 502  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 298 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (298) [["rule_id", 502]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 266]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 298 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 502]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 502 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 298) LIMIT 1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 298], ["deliverable_type", "Foo"], ["rule_id", 502], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:45.769041' WHERE "rooler_rules"."id" = 502  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:41:45 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 541], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-9"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:39:45 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 542], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 543], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 544], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-12"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 547], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 547]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 547]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 547]] Foo Load (1.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 547]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 547]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 548], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 549], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 508 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 509) LIMIT 1 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", Thu, 20 Mar 2014 14:50:45 UTC +00:00], ["deliverable_id", 509], ["deliverable_type", "Rooler::Rule"], ["rule_id", 508], ["updated_at", Thu, 20 Mar 2014 14:50:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 508]] 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", 509]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.9ms) Date: Thu, 20 Mar 2014 15:50:46 +0100 From: from@example.com To: test@email.com Message-ID: <532b0046c65d_7ade3fdd99835ad4529ae@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:50:46.063710' WHERE "rooler_deliveries"."id" = 268 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 268]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 550], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 510]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 510 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 301) LIMIT 1 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", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["deliverable_id", 301], ["deliverable_type", "Foo"], ["rule_id", 510], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:46.153604' WHERE "rooler_rules"."id" = 510  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 301]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 551], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 511]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 511 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 302) LIMIT 1 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", Thu, 20 Mar 2014 14:50:46 UTC +00:00], ["deliverable_id", 302], ["deliverable_type", "Foo"], ["rule_id", 511], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:50:46.186355' WHERE "rooler_rules"."id" = 511  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 302 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:50:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 511]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (302) [["rule_id", 511]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 270]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 552], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 512 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 512) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 512], ["deliverable_type", "Rooler::Rule"], ["rule_id", 512], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 512]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (50.3ms) Sent mail to test_name@to.com (29.0ms) Date: Thu, 20 Mar 2014 15:51:00 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b00546be1c_7b083fe628835ad8305dd@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 553], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 554], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 555], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 515]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 515 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 304) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 304], ["deliverable_type", "Foo"], ["rule_id", 515], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.528820' WHERE "rooler_rules"."id" = 515  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 515]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (304)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.533712' WHERE "rooler_rules"."id" = 515  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 556], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 557], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 558], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 517]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 517 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 307) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 307], ["deliverable_type", "Foo"], ["rule_id", 517], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.579386' WHERE "rooler_rules"."id" = 517 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 518 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 307) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 307], ["deliverable_type", "Foo"], ["rule_id", 518], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.587261' WHERE "rooler_rules"."id" = 518  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 517]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 517]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (307)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 518]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 559], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 519 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 309) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 309], ["deliverable_type", "Foo"], ["rule_id", 519], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.619160' WHERE "rooler_rules"."id" = 519  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (309))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (309)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.624986' WHERE "rooler_rules"."id" = 519  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 309 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (309) [["rule_id", 519]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 275]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 309 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 519]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 519 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 309) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 309], ["deliverable_type", "Foo"], ["rule_id", 519], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.651206' WHERE "rooler_rules"."id" = 519  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:42:00 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 560], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:40:00 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 561], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 562], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 563], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 566], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 566]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 567], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 568], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 525 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 526) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 526], ["deliverable_type", "Rooler::Rule"], ["rule_id", 525], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 525]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 526]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (54.5ms) Date: Thu, 20 Mar 2014 15:51:00 +0100 From: from@example.com To: test@email.com Message-ID: <532b0054ca07a_7b083fe628835ad8306c3@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:51:00.841769' WHERE "rooler_deliveries"."id" = 277 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 277]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 569], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 527]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 527 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 310) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 310], ["deliverable_type", "Foo"], ["rule_id", 527], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.923065' WHERE "rooler_rules"."id" = 527  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 310]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 570], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 528]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 528 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 311) LIMIT 1 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", Thu, 20 Mar 2014 14:51:00 UTC +00:00], ["deliverable_id", 311], ["deliverable_type", "Foo"], ["rule_id", 528], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:51:00.949094' WHERE "rooler_rules"."id" = 528  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 311 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:51:00 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 528]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (311) [["rule_id", 528]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 279]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 571], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 529 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 529) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 529], ["deliverable_type", "Rooler::Rule"], ["rule_id", 529], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 529]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.6ms) Sent mail to test_name@to.com (23.6ms) Date: Thu, 20 Mar 2014 15:52:15 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b009fa2549_7b1b3fd9cc435ae0890d7@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 572], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 573], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 574], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 532]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 532 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 313) LIMIT 1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 313], ["deliverable_type", "Foo"], ["rule_id", 532], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.751945' WHERE "rooler_rules"."id" = 532  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 532]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (313)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.757391' WHERE "rooler_rules"."id" = 532  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 575], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 576], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 577], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 534]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 534 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 316) LIMIT 1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 316], ["deliverable_type", "Foo"], ["rule_id", 534], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.805022' WHERE "rooler_rules"."id" = 534 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 535 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 316) LIMIT 1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 316], ["deliverable_type", "Foo"], ["rule_id", 535], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.812964' WHERE "rooler_rules"."id" = 535  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 534]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 534]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (316)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 535]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 578], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 536 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 318) LIMIT 1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 318], ["deliverable_type", "Foo"], ["rule_id", 536], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.846856' WHERE "rooler_rules"."id" = 536  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (318))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (318)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.853008' WHERE "rooler_rules"."id" = 536  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 318 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (318) [["rule_id", 536]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 284]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 318 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 536 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 318) LIMIT 1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 318], ["deliverable_type", "Foo"], ["rule_id", 536], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:15.877961' WHERE "rooler_rules"."id" = 536  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:43:15 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 579], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:41:15 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 580], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 581], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 582], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 585], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 585]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 586], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 587], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 542 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 543) LIMIT 1 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", Thu, 20 Mar 2014 14:52:15 UTC +00:00], ["deliverable_id", 543], ["deliverable_type", "Rooler::Rule"], ["rule_id", 542], ["updated_at", Thu, 20 Mar 2014 14:52:15 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 542]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 543]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (57.1ms) Date: Thu, 20 Mar 2014 15:52:16 +0100 From: from@example.com To: test@email.com Message-ID: <532b00a0cedc_7b1b3fd9cc435ae089148@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:52:16.065246' WHERE "rooler_deliveries"."id" = 286 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 286]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 588], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 544]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 544 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 319) LIMIT 1 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", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["deliverable_id", 319], ["deliverable_type", "Foo"], ["rule_id", 544], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:16.145617' WHERE "rooler_rules"."id" = 544  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 319]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 589], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 545]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 545 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 320) LIMIT 1 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", Thu, 20 Mar 2014 14:52:16 UTC +00:00], ["deliverable_id", 320], ["deliverable_type", "Foo"], ["rule_id", 545], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:16.174900' WHERE "rooler_rules"."id" = 545  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 320 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:52:16 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 545]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (320) [["rule_id", 545]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 288]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (9.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 590], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 546 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 546) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["deliverable_id", 546], ["deliverable_type", "Rooler::Rule"], ["rule_id", 546], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 546]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.2ms) Sent mail to test_name@to.com (23.5ms) Date: Thu, 20 Mar 2014 15:52:57 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b00c9e5907_7b2a3ffc91435ad068660@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 591], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 592], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 593], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 549]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 549 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 322], ["deliverable_type", "Foo"], ["rule_id", 549], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.028392' WHERE "rooler_rules"."id" = 549  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 549]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (322)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.033909' WHERE "rooler_rules"."id" = 549  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 594], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 595], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 596], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 551]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 551 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 325) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 325], ["deliverable_type", "Foo"], ["rule_id", 551], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.080003' WHERE "rooler_rules"."id" = 551 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 552]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 552 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 325) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 325], ["deliverable_type", "Foo"], ["rule_id", 552], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.088757' WHERE "rooler_rules"."id" = 552  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 551]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 551]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (325)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 552]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 552]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 552]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 597], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 553 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 327) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 327], ["deliverable_type", "Foo"], ["rule_id", 553], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.121608' WHERE "rooler_rules"."id" = 553  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (327))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (327)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.127970' WHERE "rooler_rules"."id" = 553  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 327 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (327) [["rule_id", 553]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 293]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 327 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 553 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 327) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 327], ["deliverable_type", "Foo"], ["rule_id", 553], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.154539' WHERE "rooler_rules"."id" = 553  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:43:58 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 598], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:41:58 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 599], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 600], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 601], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 604], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 604]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 605], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 606], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 559 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 560) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 560], ["deliverable_type", "Rooler::Rule"], ["rule_id", 559], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 559]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 560]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (47.9ms) Date: Thu, 20 Mar 2014 15:52:58 +0100 From: from@example.com To: test@email.com Message-ID: <532b00ca4d845_7b2a3ffc91435ad0687d4@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:52:58.329793' WHERE "rooler_deliveries"."id" = 295 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 295]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 607], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 561]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (53.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 561 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 328) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 328], ["deliverable_type", "Foo"], ["rule_id", 561], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.413409' WHERE "rooler_rules"."id" = 561  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 328]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 608], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 562 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 329) LIMIT 1 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", Thu, 20 Mar 2014 14:52:58 UTC +00:00], ["deliverable_id", 329], ["deliverable_type", "Foo"], ["rule_id", 562], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:52:58.440285' WHERE "rooler_rules"."id" = 562  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 329 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:52:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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", 562]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 297]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 609], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 563 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 563) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 563], ["deliverable_type", "Rooler::Rule"], ["rule_id", 563], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 563]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.5ms) Sent mail to test_name@to.com (24.3ms) Date: Thu, 20 Mar 2014 15:53:21 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b00e17fb62_7b353fe590435ad4475e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 610], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 611], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 612], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 566]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 566 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 331) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 331], ["deliverable_type", "Foo"], ["rule_id", 566], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.613420' WHERE "rooler_rules"."id" = 566  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 566]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (331)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.618357' WHERE "rooler_rules"."id" = 566  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 613], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 614], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 615], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 568]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 568 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 334) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 334], ["deliverable_type", "Foo"], ["rule_id", 568], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.664342' WHERE "rooler_rules"."id" = 568 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 569]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 569 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 334) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 334], ["deliverable_type", "Foo"], ["rule_id", 569], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.672511' WHERE "rooler_rules"."id" = 569  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 568]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 568]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (334)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 569]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 569]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 569]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 616], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 570 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 336) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 336], ["deliverable_type", "Foo"], ["rule_id", 570], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.705042' WHERE "rooler_rules"."id" = 570  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (336))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (336)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.711148' WHERE "rooler_rules"."id" = 570  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 336 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (336) [["rule_id", 570]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 302]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 336 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 570]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 570 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 336) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 336], ["deliverable_type", "Foo"], ["rule_id", 570], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.736312' WHERE "rooler_rules"."id" = 570  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:44:21 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 617], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:42:21 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 618], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 619], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 620], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 623], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 623]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (0.7ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 623]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 623]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 623]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 623]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 624], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 625], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 576 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 577) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 577], ["deliverable_type", "Rooler::Rule"], ["rule_id", 576], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 576]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 577]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (19.5ms) Date: Thu, 20 Mar 2014 15:53:21 +0100 From: from@example.com To: test@email.com Message-ID: <532b00e1e7fa8_7b353fe590435ad44764a@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:53:21.968015' WHERE "rooler_deliveries"."id" = 304 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 304]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 626], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 578]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 578 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 339) LIMIT 1 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", Thu, 20 Mar 2014 14:53:21 UTC +00:00], ["deliverable_id", 339], ["deliverable_type", "Foo"], ["rule_id", 578], ["updated_at", Thu, 20 Mar 2014 14:53:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:21.996799' WHERE "rooler_rules"."id" = 578  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 339]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:53:22 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 627], ["updated_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 579]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 579 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 340) LIMIT 1 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", Thu, 20 Mar 2014 14:53:22 UTC +00:00], ["deliverable_id", 340], ["deliverable_type", "Foo"], ["rule_id", 579], ["updated_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:53:22.024409' WHERE "rooler_rules"."id" = 579  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 340 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:53:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 579]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (340) [["rule_id", 579]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 306]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 628], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 580 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 580) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 580], ["deliverable_type", "Rooler::Rule"], ["rule_id", 580], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 580]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.9ms) Sent mail to test_name@to.com (23.4ms) Date: Thu, 20 Mar 2014 15:54:48 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b013878175_7b4b3fd210c35ad818936@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 629], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 630], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 631], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 583]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 583 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 342) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 342], ["deliverable_type", "Foo"], ["rule_id", 583], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.577266' WHERE "rooler_rules"."id" = 583  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 583]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (342)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.582277' WHERE "rooler_rules"."id" = 583  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 632], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 633], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 634], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 585]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 585 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 345) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 345], ["deliverable_type", "Foo"], ["rule_id", 585], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.629444' WHERE "rooler_rules"."id" = 585 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 586]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 586 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 345) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 345], ["deliverable_type", "Foo"], ["rule_id", 586], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.637201' WHERE "rooler_rules"."id" = 586  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 585]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 585]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (345)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 586]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 586]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 586]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 635], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 587 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 347) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 347], ["deliverable_type", "Foo"], ["rule_id", 587], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.670432' WHERE "rooler_rules"."id" = 587  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (347))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (347)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.676876' WHERE "rooler_rules"."id" = 587  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 347 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (347) [["rule_id", 587]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 311]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 347 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 587]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 587 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 347) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 347], ["deliverable_type", "Foo"], ["rule_id", 587], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:48.702774' WHERE "rooler_rules"."id" = 587  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:45:48 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 636], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:43:48 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 637], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 638], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 639], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 642], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 642]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" WHERE "rooler_templates"."id" = $1 LIMIT 1 [["id", 642]] Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 642]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 643], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 644], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 593 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 594) LIMIT 1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["deliverable_id", 594], ["deliverable_type", "Rooler::Rule"], ["rule_id", 593], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 593]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 594]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.8ms) Date: Thu, 20 Mar 2014 15:54:48 +0100 From: from@example.com To: test@email.com Message-ID: <532b0138de0e7_7b4b3fd210c35ad819035@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.9ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:54:48.921325' WHERE "rooler_deliveries"."id" = 313 Rooler::Delivery Load (1.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 313]]  (0.6ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 645], ["updated_at", Thu, 20 Mar 2014 14:54:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 595]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 595 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 350) LIMIT 1 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", Thu, 20 Mar 2014 14:54:49 UTC +00:00], ["deliverable_id", 350], ["deliverable_type", "Foo"], ["rule_id", 595], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:49.009812' WHERE "rooler_rules"."id" = 595  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 350]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:54:49 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 646], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 596]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 596 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 351) LIMIT 1 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", Thu, 20 Mar 2014 14:54:49 UTC +00:00], ["deliverable_id", 351], ["deliverable_type", "Foo"], ["rule_id", 596], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:54:49.036591' WHERE "rooler_rules"."id" = 596  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 351 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:54:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 596]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (351) [["rule_id", 596]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 315]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 647], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 597 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 597) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 597], ["deliverable_type", "Rooler::Rule"], ["rule_id", 597], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 597]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.2ms) Sent mail to test_name@to.com (23.4ms) Date: Thu, 20 Mar 2014 15:57:40 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b01e472c4a_7b9b3fd909835adc7645@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.6ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 648], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 649], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 650], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 600]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 600 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 353) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 353], ["deliverable_type", "Foo"], ["rule_id", 600], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.557120' WHERE "rooler_rules"."id" = 600  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 600]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (353)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.563069' WHERE "rooler_rules"."id" = 600  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 651], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 652], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 653], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 602]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 602 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 356) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 356], ["deliverable_type", "Foo"], ["rule_id", 602], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.609382' WHERE "rooler_rules"."id" = 602 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 603]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 603 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 356) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 356], ["deliverable_type", "Foo"], ["rule_id", 603], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.617179' WHERE "rooler_rules"."id" = 603  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 602]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 602]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (356)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 603]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 603]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 603]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 654], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 604 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 358) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 358], ["deliverable_type", "Foo"], ["rule_id", 604], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.649516' WHERE "rooler_rules"."id" = 604  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (358))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (358)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.656100' WHERE "rooler_rules"."id" = 604  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 358 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (358) [["rule_id", 604]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 320]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 358 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 604]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 604 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 358) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 358], ["deliverable_type", "Foo"], ["rule_id", 604], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.682101' WHERE "rooler_rules"."id" = 604  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:48:40 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 655], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:46:40 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 656], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 657], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 658], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 661], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 661]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 662], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 663], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 610 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 611) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 611], ["deliverable_type", "Rooler::Rule"], ["rule_id", 610], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 610]] 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", 611]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.0ms) Date: Thu, 20 Mar 2014 15:57:40 +0100 From: from@example.com To: test@email.com Message-ID: <532b01e4d0219_7b9b3fd909835adc77e3@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:57:40.864755' WHERE "rooler_deliveries"."id" = 322 Rooler::Delivery Load (1.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 322]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 664], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 612]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 612 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 361) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 361], ["deliverable_type", "Foo"], ["rule_id", 612], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.950451' WHERE "rooler_rules"."id" = 612  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 361]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 665], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 613]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 613 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 362) LIMIT 1 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", Thu, 20 Mar 2014 14:57:40 UTC +00:00], ["deliverable_id", 362], ["deliverable_type", "Foo"], ["rule_id", 613], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:57:40.976875' WHERE "rooler_rules"."id" = 613  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 362 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:57:40 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 613]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (362) [["rule_id", 613]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 324]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (7.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 20 Mar 2014 14:59:23 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 20 Mar 2014 14:59:23 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 666], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 614 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 614) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 614], ["deliverable_type", "Rooler::Rule"], ["rule_id", 614], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.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", 614]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.3ms) Sent mail to test_name@to.com (27.7ms) Date: Thu, 20 Mar 2014 15:59:24 +0100 From: from@example.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532b024c3c6e0_7bb43ff52dc35ad4588f1@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 667], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 668], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 669], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 617]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 617 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 364) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 364], ["deliverable_type", "Foo"], ["rule_id", 617], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.340442' WHERE "rooler_rules"."id" = 617  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 617]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (364)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.346251' WHERE "rooler_rules"."id" = 617  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 670], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 671], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 672], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 619]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 619 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 367) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 367], ["deliverable_type", "Foo"], ["rule_id", 619], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.394478' WHERE "rooler_rules"."id" = 619 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 620]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 620 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 367) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 367], ["deliverable_type", "Foo"], ["rule_id", 620], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.403831' WHERE "rooler_rules"."id" = 620  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 619]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 619]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (367)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 620]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 620]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 620]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 673], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 621 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 369) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 369], ["deliverable_type", "Foo"], ["rule_id", 621], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.441746' WHERE "rooler_rules"."id" = 621  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (369))  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (369)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.448456' WHERE "rooler_rules"."id" = 621  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 369 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (369) [["rule_id", 621]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 329]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 369 [["active", true], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 621]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 621 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 369) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 369], ["deliverable_type", "Foo"], ["rule_id", 621], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.476462' WHERE "rooler_rules"."id" = 621  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:50:24 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 674], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 20 Mar 2014 14:48:24 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 675], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 676], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 677], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 680], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 680]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 681], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 682], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 627 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 628) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 628], ["deliverable_type", "Rooler::Rule"], ["rule_id", 627], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 627]] 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", 628]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.0ms) Date: Thu, 20 Mar 2014 15:59:24 +0100 From: from@example.com To: test@email.com Message-ID: <532b024c9f39f_7bb43ff52dc35ad45898d@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.0ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-20 14:59:24.664335' WHERE "rooler_deliveries"."id" = 331 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 331]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 683], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (49.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 629]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 629 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 372) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 372], ["deliverable_type", "Foo"], ["rule_id", 629], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.745125' WHERE "rooler_rules"."id" = 629  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 372]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 684], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 630]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 630 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 373) LIMIT 1 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", Thu, 20 Mar 2014 14:59:24 UTC +00:00], ["deliverable_id", 373], ["deliverable_type", "Foo"], ["rule_id", 630], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-20 14:59:24.771756' WHERE "rooler_rules"."id" = 630  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 373 [["active", false], ["updated_at", Thu, 20 Mar 2014 14:59:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 630]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (373) [["rule_id", 630]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 333]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (20.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, 21 Mar 2014 15:41:53 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 21 Mar 2014 15:41:53 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 685], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 631 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 631) LIMIT 1 SQL (1.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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 631], ["deliverable_type", "Rooler::Rule"], ["rule_id", 631], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 631]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (5.5ms) Sent mail to test_name@to.com (20.5ms) Date: Fri, 21 Mar 2014 16:41:54 +0100 To: test_name@to.com Cc: test_name@cc.com Message-ID: <532c5dc246827_cfcf3fc1f5435ad466533@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 686], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 687], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 688], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 634]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 634 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 375) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 375], ["deliverable_type", "Foo"], ["rule_id", 634], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.370676' WHERE "rooler_rules"."id" = 634  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 634]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (375)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.376044' WHERE "rooler_rules"."id" = 634  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 689], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 690], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 691], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 636]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 636 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 378) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 378], ["deliverable_type", "Foo"], ["rule_id", 636], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.446256' WHERE "rooler_rules"."id" = 636 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 637]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 637 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 378) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 378], ["deliverable_type", "Foo"], ["rule_id", 637], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.456743' WHERE "rooler_rules"."id" = 637  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 636]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 636]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (378)) Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 637]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 637]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 637]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 692], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 638 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 380) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 380], ["deliverable_type", "Foo"], ["rule_id", 638], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.497281' WHERE "rooler_rules"."id" = 638  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (380))  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (380)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.505738' WHERE "rooler_rules"."id" = 638  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 380 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (380) [["rule_id", 638]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 338]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 380 [["active", true], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 638]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 638 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 380) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 380], ["deliverable_type", "Foo"], ["rule_id", 638], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.536821' WHERE "rooler_rules"."id" = 638  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.3ms) 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:32:54 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 693], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:30:54 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 694], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 695], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 696], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.4ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 699], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 699]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 700], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 701], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 644 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 645) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 645], ["deliverable_type", "Rooler::Rule"], ["rule_id", 644], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 644]] 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", 645]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (5.7ms) Date: Fri, 21 Mar 2014 16:41:54 +0100 To: test@email.com Message-ID: <532c5dc2b7623_cfcf3fc1f5435ad46662@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 DELIVERY ERROR: delivery id 340 - An SMTP From address is required to send a message. Set the message smtp_envelope_from, return_path, sender, or from address.  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-17"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 702], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 646]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 646 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 383) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 383], ["deliverable_type", "Foo"], ["rule_id", 646], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.778137' WHERE "rooler_rules"."id" = 646  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 383]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 703], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 647]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 647 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 384) LIMIT 1 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, 21 Mar 2014 15:41:54 UTC +00:00], ["deliverable_id", 384], ["deliverable_type", "Foo"], ["rule_id", 647], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:41:54.803590' WHERE "rooler_rules"."id" = 647  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 384 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:41:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 647]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (384) [["rule_id", 647]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 342]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.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, 21 Mar 2014 15:48:17 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 21 Mar 2014 15:48:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:17 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 704], ["updated_at", Fri, 21 Mar 2014 15:48:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 648 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 648) LIMIT 1 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, 21 Mar 2014 15:48:17 UTC +00:00], ["deliverable_id", 648], ["deliverable_type", "Rooler::Rule"], ["rule_id", 648], ["updated_at", Fri, 21 Mar 2014 15:48:17 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 648]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (4.4ms) Sent mail to test_name@to.com (19.9ms) Date: Fri, 21 Mar 2014 16:48:18 +0100 To: test_name@to.com Cc: test_name@cc.com Message-ID: <532c5f421f853_d1983fe029435adc684af@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 705], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 706], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 707], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 651]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 651 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 386) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 386], ["deliverable_type", "Foo"], ["rule_id", 651], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.226232' WHERE "rooler_rules"."id" = 651  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 651]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (386)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.233563' WHERE "rooler_rules"."id" = 651  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 708], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 709], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 710], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 653]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 653 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 389) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 389], ["deliverable_type", "Foo"], ["rule_id", 653], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.292302' WHERE "rooler_rules"."id" = 653 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 654]]  (0.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 654 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 389) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 389], ["deliverable_type", "Foo"], ["rule_id", 654], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.306673' WHERE "rooler_rules"."id" = 654  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 653]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 653]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (389)) Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 654]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 654]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 654]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 711], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 655 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 391) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 391], ["deliverable_type", "Foo"], ["rule_id", 655], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.359673' WHERE "rooler_rules"."id" = 655  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]]  (0.6ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (391))  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (391)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.369194' WHERE "rooler_rules"."id" = 655  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 391 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (391) [["rule_id", 655]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 347]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 391 [["active", true], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 655]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 655 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 391) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 391], ["deliverable_type", "Foo"], ["rule_id", 655], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.405559' WHERE "rooler_rules"."id" = 655  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:39:18 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 712], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:37:18 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 713], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 714], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 715], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-14"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 718], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 718]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 719], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 720], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 661 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 662) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 662], ["deliverable_type", "Rooler::Rule"], ["rule_id", 661], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 661]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 662]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (5.9ms) Date: Fri, 21 Mar 2014 16:48:18 +0100 To: test@email.com Message-ID: <532c5f429df31_d1983fe029435adc68535@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 DELIVERY ERROR: delivery id 349 - An SMTP From address is required to send a message. Set the message smtp_envelope_from, return_path, sender, or from address.  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 721], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 663]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 663 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 394) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 394], ["deliverable_type", "Foo"], ["rule_id", 663], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.678018' WHERE "rooler_rules"."id" = 663  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 394]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 722], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 664]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 664 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 395) LIMIT 1 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, 21 Mar 2014 15:48:18 UTC +00:00], ["deliverable_id", 395], ["deliverable_type", "Foo"], ["rule_id", 664], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:18.715469' WHERE "rooler_rules"."id" = 664  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 395 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:48:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 664]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (395) [["rule_id", 664]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 351]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (12.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 21 Mar 2014 15:48:51 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 21 Mar 2014 15:48:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 723], ["updated_at", Fri, 21 Mar 2014 15:48:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 665 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 665) LIMIT 1 SQL (1.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, 21 Mar 2014 15:48:51 UTC +00:00], ["deliverable_id", 665], ["deliverable_type", "Rooler::Rule"], ["rule_id", 665], ["updated_at", Fri, 21 Mar 2014 15:48:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 665]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.8ms) Sent mail to test_name@to.com (16.5ms) Date: Fri, 21 Mar 2014 16:48:52 +0100 To: test_name@to.com Cc: test_name@cc.com Message-ID: <532c5f64208cb_d4033fee08435ae044539@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 724], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 725], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms)[0m BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 726], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 668]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 668 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 397) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 397], ["deliverable_type", "Foo"], ["rule_id", 668], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.231642' WHERE "rooler_rules"."id" = 668  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 668]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (397)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.238701' WHERE "rooler_rules"."id" = 668  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 727], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 728], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 729], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 670]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 670 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 400) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 400], ["deliverable_type", "Foo"], ["rule_id", 670], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.298084' WHERE "rooler_rules"."id" = 670 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 671]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 671 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 400) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 400], ["deliverable_type", "Foo"], ["rule_id", 671], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.307268' WHERE "rooler_rules"."id" = 671  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 670]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 670]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (400)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 671]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 671]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 671]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 730], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 672 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 402) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 402], ["deliverable_type", "Foo"], ["rule_id", 672], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.346508' WHERE "rooler_rules"."id" = 672  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (402))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (402)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.355186' WHERE "rooler_rules"."id" = 672  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 402 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (402) [["rule_id", 672]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 356]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 402 [["active", true], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 672]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 672 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 402) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 402], ["deliverable_type", "Foo"], ["rule_id", 672], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.385933' WHERE "rooler_rules"."id" = 672  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:39:52 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 731], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:37:52 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 732], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 733], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 734], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 737], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 737]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 738], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 739], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 678 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 679) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 679], ["deliverable_type", "Rooler::Rule"], ["rule_id", 678], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 678]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 679]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (6.6ms) Date: Fri, 21 Mar 2014 16:48:52 +0100 To: test@email.com Message-ID: <532c5f64926f9_d4033fee08435ae04467d@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 DELIVERY ERROR: delivery id 358 - An SMTP From address is required to send a message. Set the message smtp_envelope_from, return_path, sender, or from address.  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 740], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 680]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 680 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 405) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 405], ["deliverable_type", "Foo"], ["rule_id", 680], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.632508' WHERE "rooler_rules"."id" = 680  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 405]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 741], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 681]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 681 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 406) LIMIT 1 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, 21 Mar 2014 15:48:52 UTC +00:00], ["deliverable_id", 406], ["deliverable_type", "Foo"], ["rule_id", 681], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:48:52.664782' WHERE "rooler_rules"."id" = 681  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 406 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:48:52 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 681]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (406) [["rule_id", 681]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 360]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) ROLLBACK  (1.6ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (1.4ms) SAVEPOINT active_record_1 SQL (18.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 21 Mar 2014 15:54:51 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 21 Mar 2014 15:54:51 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (7.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 742], ["updated_at", Fri, 21 Mar 2014 15:54:51 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (11.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 682 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 682) LIMIT 1 SQL (9.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, 21 Mar 2014 15:54:51 UTC +00:00], ["deliverable_id", 682], ["deliverable_type", "Rooler::Rule"], ["rule_id", 682], ["updated_at", Fri, 21 Mar 2014 15:54:51 UTC +00:00]]  (7.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (6.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", 682]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (17.1ms) Sent mail to test_name@to.com (52.0ms) Date: Fri, 21 Mar 2014 16:54:52 +0100 To: test_name@to.com Cc: test_name@cc.com Message-ID: <532c60cc5d9d1_da913fc558435adc922e7@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (3.6ms) ROLLBACK  (1.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (4.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 743], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (4.9ms) RELEASE SAVEPOINT active_record_1 Foo Load (5.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SAVEPOINT active_record_1 SQL (2.7ms) 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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 SQL (4.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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 744], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.2ms) 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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 745], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (2.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 685]] Foo Load (1.9ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 685 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 408) LIMIT 1 SQL (4.2ms) 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, 21 Mar 2014 15:54:52 UTC +00:00], ["deliverable_id", 408], ["deliverable_type", "Foo"], ["rule_id", 685], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (2.1ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.647057' WHERE "rooler_rules"."id" = 685  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 685]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (408)) SQL (1.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.660615' WHERE "rooler_rules"."id" = 685  (1.9ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.8ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 746], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (3.4ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.4ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (4.6ms) SAVEPOINT active_record_1 SQL (2.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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 747], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (2.1ms) SAVEPOINT active_record_1 SQL (5.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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (2.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 748], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (3.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 687]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (13.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 687 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 411) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:54:52 UTC +00:00], ["deliverable_id", 411], ["deliverable_type", "Foo"], ["rule_id", 687], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (2.1ms) RELEASE SAVEPOINT active_record_1 SQL (2.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.817908' WHERE "rooler_rules"."id" = 687 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 688]]  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 688 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 411) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:54:52 UTC +00:00], ["deliverable_id", 411], ["deliverable_type", "Foo"], ["rule_id", 688], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (6.4ms) RELEASE SAVEPOINT active_record_1 SQL (2.1ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.847040' WHERE "rooler_rules"."id" = 688  (0.3ms) SAVEPOINT active_record_1 SQL (2.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (4.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 687]]  (1.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 687]] Foo Load (1.9ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (411)) Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 688]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 688]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 688]]  (3.2ms) ROLLBACK  (1.6ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (13.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (3.4ms) RELEASE SAVEPOINT active_record_1  (2.2ms) SAVEPOINT active_record_1 SQL (3.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, 21 Mar 2014 15:54:52 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (5.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, 21 Mar 2014 15:54:52 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 749], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]] Foo Load (2.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (3.0ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 689 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 413) LIMIT 1 SQL (3.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, 21 Mar 2014 15:54:52 UTC +00:00], ["deliverable_id", 413], ["deliverable_type", "Foo"], ["rule_id", 689], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.977154' WHERE "rooler_rules"."id" = 689  (2.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]]  (0.8ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (413))  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (413)) SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:52.993309' WHERE "rooler_rules"."id" = 689  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (5.3ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 413 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:54:52 UTC +00:00]]  (4.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]] Foo Load (1.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (413) [["rule_id", 689]]  (0.4ms) SAVEPOINT active_record_1 SQL (9.8ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 365]]  (1.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 413 [["active", true], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 689]] Foo Load (3.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (2.8ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 689 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 413) LIMIT 1 SQL (1.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, 21 Mar 2014 15:54:53 UTC +00:00], ["deliverable_id", 413], ["deliverable_type", "Foo"], ["rule_id", 689], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:53.080216' WHERE "rooler_rules"."id" = 689  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) ROLLBACK  (1.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (1.0ms) SAVEPOINT active_record_1 SQL (3.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, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:45:53 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 750], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 SQL (2.4ms) 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, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (1.6ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.4ms) 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, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:43:53 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 751], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 752], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 753], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (1.7ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (2.2ms) 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())  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (1.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.4ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 756], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 756]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 757], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) 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, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 758], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 695 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 696) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:54:53 UTC +00:00], ["deliverable_id", 696], ["deliverable_type", "Rooler::Rule"], ["rule_id", 695], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.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", 695]] Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 696]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (8.6ms) Date: Fri, 21 Mar 2014 16:54:53 +0100 To: test@email.com Message-ID: <532c60cd7316e_da913fc558435adc923a1@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 DELIVERY ERROR: delivery id 367 - An SMTP From address is required to send a message. Set the message smtp_envelope_from, return_path, sender, or from address.  (0.3ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-17"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 759], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 697]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 697 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 416) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:54:53 UTC +00:00], ["deliverable_id", 416], ["deliverable_type", "Foo"], ["rule_id", 697], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:53.523376' WHERE "rooler_rules"."id" = 697  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 416]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:54:53 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 760], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 698]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 698 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 417) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:54:53 UTC +00:00], ["deliverable_id", 417], ["deliverable_type", "Foo"], ["rule_id", 698], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:54:53.566846' WHERE "rooler_rules"."id" = 698  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 417 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:54:53 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 698]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (417) [["rule_id", 698]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 369]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (14.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 761], ["updated_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 699 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 699) LIMIT 1 SQL (1.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, 21 Mar 2014 15:56:56 UTC +00:00], ["deliverable_id", 699], ["deliverable_type", "Rooler::Rule"], ["rule_id", 699], ["updated_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.4ms) 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", 699]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (10.1ms) Sent mail to test_name@to.com (64.0ms) Date: Fri, 21 Mar 2014 16:56:56 +0100 From: default@test-server.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532c6148d6669_de0a3ffea4435ad41141e@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (1.0ms) ROLLBACK  (0.8ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.5ms) SAVEPOINT active_record_1 SQL (4.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (3.1ms) SAVEPOINT active_record_1 SQL (5.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, 21 Mar 2014 15:56:56 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00]]  (2.5ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:56:56 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 762], ["updated_at", Fri, 21 Mar 2014 15:56:56 UTC +00:00]]  (3.4ms) RELEASE SAVEPOINT active_record_1 Foo Load (4.0ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 763], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.5ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (5.9ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (5.4ms) RELEASE SAVEPOINT active_record_1  (1.3ms) SAVEPOINT active_record_1 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-3"], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 764], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (3.1ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 702]] Foo Load (1.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 702 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 419) LIMIT 1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["deliverable_id", 419], ["deliverable_type", "Foo"], ["rule_id", 702], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (7.2ms) RELEASE SAVEPOINT active_record_1 SQL (2.1ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.146051' WHERE "rooler_rules"."id" = 702  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (5.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 702]] Foo Load (8.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (419)) SQL (3.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.171987' WHERE "rooler_rules"."id" = 702  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (8.2ms) SAVEPOINT active_record_1 SQL (4.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 765], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (5.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" LIMIT 1  (1.0ms) ROLLBACK  (0.4ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (4.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 SQL (1.8ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (3.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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 766], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (4.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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (6.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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 767], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (3.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 704]] Foo Load (3.1ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (1.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 704 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 422) LIMIT 1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["deliverable_id", 422], ["deliverable_type", "Foo"], ["rule_id", 704], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.9ms) RELEASE SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.350914' WHERE "rooler_rules"."id" = 704 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t')  (1.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 705]]  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 705 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 422) LIMIT 1 SQL (2.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, 21 Mar 2014 15:56:57 UTC +00:00], ["deliverable_id", 422], ["deliverable_type", "Foo"], ["rule_id", 705], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.8ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.374999' WHERE "rooler_rules"."id" = 705  (2.0ms) SAVEPOINT active_record_1 SQL (5.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (3.9ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (4.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 704]]  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 704]] Foo Load (3.9ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (422)) Rooler::Rule Load (1.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 705]] Foo Load (6.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (5.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 705]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 705]]  (1.4ms) ROLLBACK  (2.4ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 SQL (1.8ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 768], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]] Foo Load (8.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (1.9ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (3.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 706 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 424) LIMIT 1 SQL (6.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, 21 Mar 2014 15:56:57 UTC +00:00], ["deliverable_id", 424], ["deliverable_type", "Foo"], ["rule_id", 706], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.510251' WHERE "rooler_rules"."id" = 706  (4.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]]  (6.1ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (424))  (2.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (424)) SQL (3.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.535436' WHERE "rooler_rules"."id" = 706  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (7.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 424 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (2.1ms) RELEASE SAVEPOINT active_record_1  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]] Foo Load (2.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (6.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (424) [["rule_id", 706]]  (0.7ms) SAVEPOINT active_record_1 SQL (4.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 374]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (2.3ms) SAVEPOINT active_record_1 SQL (2.2ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 424 [["active", true], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SELECT COUNT(*) FROM "rooler_deliveries"  (4.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 706]] Foo Load (1.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (1.7ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 706 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 424) LIMIT 1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["deliverable_id", 424], ["deliverable_type", "Foo"], ["rule_id", 706], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:57.628963' WHERE "rooler_rules"."id" = 706  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (1.2ms) SAVEPOINT active_record_1 SQL (7.0ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.9ms) SAVEPOINT active_record_1 SQL (7.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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:47:57 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 769], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (4.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:45:57 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 770], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (2.8ms) SAVEPOINT active_record_1 SQL (4.4ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (2.9ms) RELEASE SAVEPOINT active_record_1  (1.1ms) SAVEPOINT active_record_1 SQL (3.3ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 771], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (3.4ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (4.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 772], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (2.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (2.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())  (2.2ms) ROLLBACK  (3.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (3.5ms) SAVEPOINT active_record_1  (7.0ms) ROLLBACK TO SAVEPOINT active_record_1  (0.7ms) SAVEPOINT active_record_1 SQL (3.3ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (1.8ms) ROLLBACK  (2.3ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 775], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (3.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 775]] Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Foo Load (2.1ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.7ms) SAVEPOINT active_record_1 SQL (2.0ms) 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, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 776], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (2.4ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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-16"], ["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 777], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (4.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 712 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 713) LIMIT 1 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, 21 Mar 2014 15:56:57 UTC +00:00], ["deliverable_id", 713], ["deliverable_type", "Rooler::Rule"], ["rule_id", 712], ["updated_at", Fri, 21 Mar 2014 15:56:57 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (3.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", 712]] Rooler::Rule Load (1.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 713]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (35.7ms) Date: Fri, 21 Mar 2014 16:56:58 +0100 From: default@test-server.com To: test@email.com Message-ID: <532c614ab6db_de0a3ffea4435ad4115d3@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-21 15:56:58.076866' WHERE "rooler_deliveries"."id" = 376 Rooler::Delivery Load (3.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 376]]  (0.7ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (2.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.5ms) SAVEPOINT active_record_1 SQL (5.3ms) 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, 21 Mar 2014 15:56:58 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (4.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, 21 Mar 2014 15:56:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 778], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (1.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 714]] Foo Load (4.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (9.4ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 714 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 427) LIMIT 1 SQL (4.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, 21 Mar 2014 15:56:58 UTC +00:00], ["deliverable_id", 427], ["deliverable_type", "Foo"], ["rule_id", 714], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.8ms) RELEASE SAVEPOINT active_record_1 SQL (1.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:58.250339' WHERE "rooler_rules"."id" = 714  (2.8ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 427]]  (0.4ms) ROLLBACK  (1.5ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (5.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (2.4ms) SAVEPOINT active_record_1 SQL (5.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, 21 Mar 2014 15:56:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 779], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (1.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 715]] Foo Load (1.9ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.5ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (5.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 715 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 428) LIMIT 1 SQL (1.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, 21 Mar 2014 15:56:58 UTC +00:00], ["deliverable_id", 428], ["deliverable_type", "Foo"], ["rule_id", 715], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (4.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:56:58.343247' WHERE "rooler_rules"."id" = 715  (11.8ms) SAVEPOINT active_record_1 SQL (1.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 428 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:56:58 UTC +00:00]]  (7.7ms) RELEASE SAVEPOINT active_record_1  (2.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (1.9ms) SELECT "rooler_rules".* FROM "rooler_rules"  (2.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 715]] Foo Load (3.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (1.2ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (428) [["rule_id", 715]]  (1.6ms) SAVEPOINT active_record_1 SQL (0.8ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 378]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (5.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (8.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, 21 Mar 2014 15:57:20 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 21 Mar 2014 15:57:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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, 21 Mar 2014 15:57:20 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 780], ["updated_at", Fri, 21 Mar 2014 15:57:20 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 716 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 716) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 716], ["deliverable_type", "Rooler::Rule"], ["rule_id", 716], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 716]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.9ms) Sent mail to test_name@to.com (28.7ms) Date: Fri, 21 Mar 2014 16:57:21 +0100 From: default@test-server.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <532c61612a029_e9bc3fe55c835adc915ca@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 781], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 782], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 783], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 719]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 719 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 430) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 430], ["deliverable_type", "Foo"], ["rule_id", 719], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.275465' WHERE "rooler_rules"."id" = 719  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 719]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (430)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.282748' WHERE "rooler_rules"."id" = 719  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 784], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 785], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 786], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 721]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 721 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 433) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 433], ["deliverable_type", "Foo"], ["rule_id", 721], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.337770' WHERE "rooler_rules"."id" = 721 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 722]]  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 722 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 433) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 433], ["deliverable_type", "Foo"], ["rule_id", 722], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.346785' WHERE "rooler_rules"."id" = 722  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 721]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 721]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (433)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 722]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 722]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 722]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 787], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 723 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 435) LIMIT 1 SQL (1.1ms) 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 435], ["deliverable_type", "Foo"], ["rule_id", 723], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.385088' WHERE "rooler_rules"."id" = 723  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]]  (0.6ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (435))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (435)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.392515' WHERE "rooler_rules"."id" = 723  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 435 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (435) [["rule_id", 723]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 383]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 435 [["active", true], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 723]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 723 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 435) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 435], ["deliverable_type", "Foo"], ["rule_id", 723], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.425233' WHERE "rooler_rules"."id" = 723  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:48:21 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 788], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-9"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 21 Mar 2014 15:46:21 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 789], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 790], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 791], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 794], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 794]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 795], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 796], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 729 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 730) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 730], ["deliverable_type", "Rooler::Rule"], ["rule_id", 729], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 729]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 730]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (14.4ms) Date: Fri, 21 Mar 2014 16:57:21 +0100 From: default@test-server.com To: test@email.com Message-ID: <532c61618bb56_e9bc3fe55c835adc916ae@Yonahs-MacBook-Pro.local.mail> Subject: subject-15 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-15 SQL (1.1ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-21 15:57:21.584910' WHERE "rooler_deliveries"."id" = 385 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 385]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-17"], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 797], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 731]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 731 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 438) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 438], ["deliverable_type", "Foo"], ["rule_id", 731], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (1.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.665497' WHERE "rooler_rules"."id" = 731  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 438]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 798], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 732]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 732 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 439) LIMIT 1 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, 21 Mar 2014 15:57:21 UTC +00:00], ["deliverable_id", 439], ["deliverable_type", "Foo"], ["rule_id", 732], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-21 15:57:21.698249' WHERE "rooler_rules"."id" = 732  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 439 [["active", false], ["updated_at", Fri, 21 Mar 2014 15:57:21 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 732]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (439) [["rule_id", 732]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 387]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (10.3ms) SAVEPOINT active_record_1 SQL (48.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 24 Mar 2014 11:48:57 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 24 Mar 2014 11:48:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Mon, 24 Mar 2014 11:48:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 1], ["updated_at", Mon, 24 Mar 2014 11:48:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 1 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 1) LIMIT 1 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", Mon, 24 Mar 2014 11:48:57 UTC +00:00], ["deliverable_id", 1], ["deliverable_type", "Rooler::Rule"], ["rule_id", 1], ["updated_at", Mon, 24 Mar 2014 11:48:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (31.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", 1]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (8.2ms) Sent mail to test_name@to.com (140.0ms) Date: Mon, 24 Mar 2014 12:48:58 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53301baa54b60_18b63fc595035ad06049@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.7ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 2], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 3], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-3"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 4], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 4 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 2) LIMIT 1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["deliverable_id", 2], ["deliverable_type", "Foo"], ["rule_id", 4], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.536722' WHERE "rooler_rules"."id" = 4  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 4]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (2)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.545382' WHERE "rooler_rules"."id" = 4  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 5], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 6], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 7], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 6 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 5) LIMIT 1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["deliverable_id", 5], ["deliverable_type", "Foo"], ["rule_id", 6], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.625011' WHERE "rooler_rules"."id" = 6 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 7 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 5) LIMIT 1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["deliverable_id", 5], ["deliverable_type", "Foo"], ["rule_id", 7], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.634296' WHERE "rooler_rules"."id" = 7  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 6]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 6]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (5)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 7]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 7]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 8], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (1.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 8 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 7) LIMIT 1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["deliverable_id", 7], ["deliverable_type", "Foo"], ["rule_id", 8], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.682572' WHERE "rooler_rules"."id" = 8  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (7))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (7)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.690523' WHERE "rooler_rules"."id" = 8  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 7 [["active", false], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (7) [["rule_id", 8]]  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 5]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 7 [["active", true], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 8]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 8 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 7) LIMIT 1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["deliverable_id", 7], ["deliverable_type", "Foo"], ["rule_id", 8], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:58.727109' WHERE "rooler_rules"."id" = 8  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 24 Mar 2014 11:39:58 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 9], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 24 Mar 2014 11:37:58 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 10], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-10"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (3.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", 600], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 11], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SAVEPOINT active_record_1 SQL (12.2ms) 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (4.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 12], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (1.6ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (33.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-12"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (1.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.5ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 15], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 15]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 16], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.1ms) ROLLBACK  (0.4ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (1.5ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 17], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 18], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 15 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 16) LIMIT 1 SQL (1.1ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["deliverable_id", 16], ["deliverable_type", "Rooler::Rule"], ["rule_id", 15], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 15]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 16]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (70.3ms) Date: Mon, 24 Mar 2014 12:48:59 +0100 From: default@myapp.com To: test@email.com Message-ID: <53301bab18585_18b63fc595035ad061c@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.6ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-24 11:48:59.167805' WHERE "rooler_deliveries"."id" = 7 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 7]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 19], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 17]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 17 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 11) LIMIT 1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["deliverable_id", 11], ["deliverable_type", "Foo"], ["rule_id", 17], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:59.211764' WHERE "rooler_rules"."id" = 17  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.1ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 11]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 20], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 18]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 18 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 12) LIMIT 1 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", Mon, 24 Mar 2014 11:48:59 UTC +00:00], ["deliverable_id", 12], ["deliverable_type", "Foo"], ["rule_id", 18], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:48:59.257812' WHERE "rooler_rules"."id" = 18  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 12 [["active", false], ["updated_at", Mon, 24 Mar 2014 11:48:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 18]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (12) [["rule_id", 18]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 9]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (7.8ms) 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 21], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 19 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 19) LIMIT 1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["deliverable_id", 19], ["deliverable_type", "Rooler::Rule"], ["rule_id", 19], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.0ms) 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", 19]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (5.0ms) Sent mail to test_name@to.com (69.4ms) Date: Mon, 24 Mar 2014 12:49:48 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53301bdc96ac0_18e23fc99c835ae0476fc@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 22], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 23], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 24], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 22 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 14) LIMIT 1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["deliverable_id", 14], ["deliverable_type", "Foo"], ["rule_id", 22], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.754582' WHERE "rooler_rules"."id" = 22  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 22]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (14)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.760058' WHERE "rooler_rules"."id" = 22  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 25], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 26], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 27], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 24]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 24 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 17) LIMIT 1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["deliverable_id", 17], ["deliverable_type", "Foo"], ["rule_id", 24], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.816192' WHERE "rooler_rules"."id" = 24 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 25]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 25 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 17) LIMIT 1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["deliverable_id", 17], ["deliverable_type", "Foo"], ["rule_id", 25], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.829162' WHERE "rooler_rules"."id" = 25  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 24]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 24]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (17)) Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 25]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 25]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 25]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 28], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 26]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 26 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 19) LIMIT 1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["deliverable_id", 19], ["deliverable_type", "Foo"], ["rule_id", 26], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.876397' WHERE "rooler_rules"."id" = 26  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 26]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (19))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 26]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (19)) SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.885434' WHERE "rooler_rules"."id" = 26  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 19 [["active", false], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 26]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (19) [["rule_id", 26]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 14]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 19 [["active", true], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 26]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 26 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 19) LIMIT 1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["deliverable_id", 19], ["deliverable_type", "Foo"], ["rule_id", 26], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:48.917611' WHERE "rooler_rules"."id" = 26  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.4ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-8"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 24 Mar 2014 11:40:48 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 29], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 24 Mar 2014 11:38:48 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 30], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 31], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 32], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.4ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.9ms) 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", Mon, 24 Mar 2014 11:49:48 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-14"], ["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 35], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 35]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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-15"], ["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 36], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.6ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 37], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 38], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 33 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 34) LIMIT 1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["deliverable_id", 34], ["deliverable_type", "Rooler::Rule"], ["rule_id", 33], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 33]] Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 34]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (52.5ms) Date: Mon, 24 Mar 2014 12:49:49 +0100 From: default@myapp.com To: test@email.com Message-ID: <53301bdd22932_18e23fc99c835ae047768@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.8ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-24 11:49:49.192591' WHERE "rooler_deliveries"."id" = 16 Rooler::Delivery Load (1.1ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 16]]  (0.5ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 39], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 35]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 35 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 23) LIMIT 1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["deliverable_id", 23], ["deliverable_type", "Foo"], ["rule_id", 35], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:49.227180' WHERE "rooler_rules"."id" = 35  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 23]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 40], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 36]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 36 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 24) LIMIT 1 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", Mon, 24 Mar 2014 11:49:49 UTC +00:00], ["deliverable_id", 24], ["deliverable_type", "Foo"], ["rule_id", 36], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:49:49.257953' WHERE "rooler_rules"."id" = 36  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 24 [["active", false], ["updated_at", Mon, 24 Mar 2014 11:49:49 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 36]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (24) [["rule_id", 36]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 18]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (12.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.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", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 41], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 37 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 37) LIMIT 1 SQL (1.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", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["deliverable_id", 37], ["deliverable_type", "Rooler::Rule"], ["rule_id", 37], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (3.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", 37]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (4.9ms) Sent mail to test_name@to.com (27.9ms) Date: Mon, 24 Mar 2014 12:59:23 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53301e1be31e4_19dc3fecf9035ae0880d@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 42], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 43], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 44], ["updated_at", Mon, 24 Mar 2014 11:59:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 40]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 40 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 26) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 26], ["deliverable_type", "Foo"], ["rule_id", 40], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.026838' WHERE "rooler_rules"."id" = 40  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 40]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (26)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.032295' WHERE "rooler_rules"."id" = 40  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 45], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-5"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 46], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 47], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 42]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 42 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Foo"], ["rule_id", 42], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.084726' WHERE "rooler_rules"."id" = 42 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 43]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 43 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 29) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 29], ["deliverable_type", "Foo"], ["rule_id", 43], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.093004' WHERE "rooler_rules"."id" = 43  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 42]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 42]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (29)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 43]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 43]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 43]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 48], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 44]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 44 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 31) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 31], ["deliverable_type", "Foo"], ["rule_id", 44], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.127444' WHERE "rooler_rules"."id" = 44  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 44]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (31))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 44]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (31)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.133844' WHERE "rooler_rules"."id" = 44  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 31 [["active", false], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 44]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (31) [["rule_id", 44]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 23]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 31 [["active", true], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 44]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 44 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 31) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 31], ["deliverable_type", "Foo"], ["rule_id", 44], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.161823' WHERE "rooler_rules"."id" = 44  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 24 Mar 2014 11:50:24 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 49], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 24 Mar 2014 11:48:24 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 50], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 51], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 52], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 55], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 55]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 56], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 57], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 58], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 51 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 52) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 52], ["deliverable_type", "Rooler::Rule"], ["rule_id", 51], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 51]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 52]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.2ms) Date: Mon, 24 Mar 2014 12:59:24 +0100 From: default@myapp.com To: test@email.com Message-ID: <53301e1c58ee6_19dc3fecf9035ae0881a2@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-24 11:59:24.376214' WHERE "rooler_deliveries"."id" = 25 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 25]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 59], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 53]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 53 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 35) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 35], ["deliverable_type", "Foo"], ["rule_id", 53], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.403493' WHERE "rooler_rules"."id" = 53  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 35]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 60], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 54]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 54 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 36) LIMIT 1 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", Mon, 24 Mar 2014 11:59:24 UTC +00:00], ["deliverable_id", 36], ["deliverable_type", "Foo"], ["rule_id", 54], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-24 11:59:24.430761' WHERE "rooler_rules"."id" = 54  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 36 [["active", false], ["updated_at", Mon, 24 Mar 2014 11:59:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 54]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (36) [["rule_id", 54]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 27]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (16.9ms) SAVEPOINT active_record_1 SQL (99.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", Thu, 27 Mar 2014 15:50:42 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 15:50:42 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (19.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 61], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (38.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 55 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 SQL (1.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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Rooler::Rule"], ["rule_id", 55], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.4ms) 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", 55]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.0ms) Sent mail to test_name@to.com (48.6ms) Date: Thu, 27 Mar 2014 16:50:43 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533448d3810cb_1c43fead8434ce0336b@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (33.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 62], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 63], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 64], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 58]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 58 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 38) LIMIT 1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["deliverable_id", 38], ["deliverable_type", "Foo"], ["rule_id", 58], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.647850' WHERE "rooler_rules"."id" = 58  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 58]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (38)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.652268' WHERE "rooler_rules"."id" = 58  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 65], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 66], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 67], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 60 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 41) LIMIT 1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["deliverable_id", 41], ["deliverable_type", "Foo"], ["rule_id", 60], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.746287' WHERE "rooler_rules"."id" = 60 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 61]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 61 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 41) LIMIT 1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["deliverable_id", 41], ["deliverable_type", "Foo"], ["rule_id", 61], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.753759' WHERE "rooler_rules"."id" = 61  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 60]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 60]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (41)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 61]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 61]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 61]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 68], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 62 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 43) LIMIT 1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["deliverable_id", 43], ["deliverable_type", "Foo"], ["rule_id", 62], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.787696' WHERE "rooler_rules"."id" = 62  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (43))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (43)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.793326' WHERE "rooler_rules"."id" = 62  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 43 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (43) [["rule_id", 62]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 32]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 43 [["active", true], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 62]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 62 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 43) LIMIT 1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["deliverable_id", 43], ["deliverable_type", "Foo"], ["rule_id", 62], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:43.815510' WHERE "rooler_rules"."id" = 62  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:41:43 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 69], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:39:43 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 70], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 71], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 72], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (47.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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 75], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 75]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:43 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:43 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 76], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 77], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 78], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 69 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 70) LIMIT 1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["deliverable_id", 70], ["deliverable_type", "Rooler::Rule"], ["rule_id", 69], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 69]] 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", 70]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.4ms) Date: Thu, 27 Mar 2014 16:50:44 +0100 From: default@myapp.com To: test@email.com Message-ID: <533448d414bcf_1c43fead8434ce0344@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 15:50:44.096791' WHERE "rooler_deliveries"."id" = 34 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 34]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 79], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 71]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 71 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 47) LIMIT 1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["deliverable_id", 47], ["deliverable_type", "Foo"], ["rule_id", 71], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:44.127583' WHERE "rooler_rules"."id" = 71  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 47]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 80], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 72]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 72 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 48) LIMIT 1 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", Thu, 27 Mar 2014 15:50:44 UTC +00:00], ["deliverable_id", 48], ["deliverable_type", "Foo"], ["rule_id", 72], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:50:44.213116' WHERE "rooler_rules"."id" = 72  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 48 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:50:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 72]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (48) [["rule_id", 72]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 36]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (32.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", Thu, 27 Mar 2014 15:53:35 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 15:53:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:35 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 81], ["updated_at", Thu, 27 Mar 2014 15:53:35 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 73 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 73) LIMIT 1 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", Thu, 27 Mar 2014 15:53:35 UTC +00:00], ["deliverable_id", 73], ["deliverable_type", "Rooler::Rule"], ["rule_id", 73], ["updated_at", Thu, 27 Mar 2014 15:53:35 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 73]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (58.0ms) Sent mail to test_name@to.com (35.1ms) Date: Thu, 27 Mar 2014 16:53:36 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533449803ce35_2a63fce61834cd49128c@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 82], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 83], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 84], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 76]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 76 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 50) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 50], ["deliverable_type", "Foo"], ["rule_id", 76], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.369743' WHERE "rooler_rules"."id" = 76  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 76]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (50)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.376200' WHERE "rooler_rules"."id" = 76  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 85], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 86], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 87], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 78]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 78 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 53) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 53], ["deliverable_type", "Foo"], ["rule_id", 78], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.440451' WHERE "rooler_rules"."id" = 78 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 79]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 79 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 53) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 53], ["deliverable_type", "Foo"], ["rule_id", 79], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.448129' WHERE "rooler_rules"."id" = 79  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 78]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 78]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (53)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 79]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 79]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 79]]  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 88], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 80]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 80 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Foo"], ["rule_id", 80], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.478003' WHERE "rooler_rules"."id" = 80  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 80]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (55))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 80]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (55)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.483453' WHERE "rooler_rules"."id" = 80  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 55 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 80]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (55) [["rule_id", 80]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 41]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 55 [["active", true], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 80]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 80 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 55) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 55], ["deliverable_type", "Foo"], ["rule_id", 80], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.516399' WHERE "rooler_rules"."id" = 80  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:44:36 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 89], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:42:36 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 90], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 91], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 92], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 95], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 95]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 96], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 97], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 98], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 87 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 88) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 88], ["deliverable_type", "Rooler::Rule"], ["rule_id", 87], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 87]] Rooler::Rule Load (1.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 88]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.1ms) Date: Thu, 27 Mar 2014 16:53:36 +0100 From: default@myapp.com To: test@email.com Message-ID: <53344980bd9dd_2a63fce61834cd491366@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 15:53:36.788206' WHERE "rooler_deliveries"."id" = 43 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 43]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 99], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 89]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 89 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 59) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 59], ["deliverable_type", "Foo"], ["rule_id", 89], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.812257' WHERE "rooler_rules"."id" = 89  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 59]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 100], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 90 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 60) LIMIT 1 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", Thu, 27 Mar 2014 15:53:36 UTC +00:00], ["deliverable_id", 60], ["deliverable_type", "Foo"], ["rule_id", 90], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:53:36.838646' WHERE "rooler_rules"."id" = 90  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 60 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 90]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (60) [["rule_id", 90]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 45]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (78.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Mar 2014 15:55:45 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 15:55:45 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:45 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 101], ["updated_at", Thu, 27 Mar 2014 15:55:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 91 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 SQL (16.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", Thu, 27 Mar 2014 15:55:45 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Rooler::Rule"], ["rule_id", 91], ["updated_at", Thu, 27 Mar 2014 15:55:45 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 91]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (50.2ms) Sent mail to test_name@to.com (61.4ms) Date: Thu, 27 Mar 2014 16:55:46 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53344a02f8a0_3173ff822034cd82557a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (23.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 102], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 103], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 104], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 94]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 94 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 62) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 62], ["deliverable_type", "Foo"], ["rule_id", 94], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.213701' WHERE "rooler_rules"."id" = 94  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 94]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (62)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.219748' WHERE "rooler_rules"."id" = 94  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 105], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-5"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 106], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 107], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 96]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 96 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 65) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 65], ["deliverable_type", "Foo"], ["rule_id", 96], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.304529' WHERE "rooler_rules"."id" = 96 Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE ('t')  (2.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 97 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 65) LIMIT 1 SQL (4.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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 65], ["deliverable_type", "Foo"], ["rule_id", 97], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (4.4ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.329023' WHERE "rooler_rules"."id" = 97  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 96]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 96]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (65)) Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 97]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 97]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-7"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 108], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 98 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 67) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 67], ["deliverable_type", "Foo"], ["rule_id", 98], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.369652' WHERE "rooler_rules"."id" = 98  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]]  (0.2ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (67))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (67)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.375182' WHERE "rooler_rules"."id" = 98  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 67 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (67) [["rule_id", 98]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 50]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 67 [["active", true], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 98]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 98 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 67) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 67], ["deliverable_type", "Foo"], ["rule_id", 98], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.400499' WHERE "rooler_rules"."id" = 98  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:46:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 109], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:44:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 110], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 111], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 112], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 115], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 115]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.5ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.9ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.6ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 116], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.9ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 117], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 118], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 105 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 106) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 106], ["deliverable_type", "Rooler::Rule"], ["rule_id", 105], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 105]] 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", 106]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (15.0ms) Date: Thu, 27 Mar 2014 16:55:46 +0100 From: default@myapp.com To: test@email.com Message-ID: <53344a02ba325_3173ff822034cd8256a5@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 15:55:46.774827' WHERE "rooler_deliveries"."id" = 52 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 52]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-18"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 119], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 107]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 107 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 71) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 71], ["deliverable_type", "Foo"], ["rule_id", 107], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.802887' WHERE "rooler_rules"."id" = 107  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 71]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 120], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 108]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 108 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 72) LIMIT 1 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", Thu, 27 Mar 2014 15:55:46 UTC +00:00], ["deliverable_id", 72], ["deliverable_type", "Foo"], ["rule_id", 108], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:55:46.878431' WHERE "rooler_rules"."id" = 108  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 72 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:55:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 108]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (72) [["rule_id", 108]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 54]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (30.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", Thu, 27 Mar 2014 15:56:43 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 15:56:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:43 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 121], ["updated_at", Thu, 27 Mar 2014 15:56:43 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 109 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 109) LIMIT 1 SQL (16.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", Thu, 27 Mar 2014 15:56:43 UTC +00:00], ["deliverable_id", 109], ["deliverable_type", "Rooler::Rule"], ["rule_id", 109], ["updated_at", Thu, 27 Mar 2014 15:56:43 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 109]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (49.3ms) Sent mail to test_name@to.com (67.1ms) Date: Thu, 27 Mar 2014 16:56:44 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53344a3c5a58_4073ff339c34cd8792b6@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 122], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 123], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 124], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 112 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 74) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 74], ["deliverable_type", "Foo"], ["rule_id", 112], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.128068' WHERE "rooler_rules"."id" = 112  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 112]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (74)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.133245' WHERE "rooler_rules"."id" = 112  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 125], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 126], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 127], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 114]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 114 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 77], ["deliverable_type", "Foo"], ["rule_id", 114], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.194855' WHERE "rooler_rules"."id" = 114 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 115]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 115 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 77) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 77], ["deliverable_type", "Foo"], ["rule_id", 115], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.205536' WHERE "rooler_rules"."id" = 115  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 114]]  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 114]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (77)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 115]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 115]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 115]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 128], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 116 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 79) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 79], ["deliverable_type", "Foo"], ["rule_id", 116], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.246981' WHERE "rooler_rules"."id" = 116  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (79))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (79)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.255176' WHERE "rooler_rules"."id" = 116  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 79 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (79) [["rule_id", 116]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 59]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 79 [["active", true], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 116]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 116 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 79) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 79], ["deliverable_type", "Foo"], ["rule_id", 116], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.282634' WHERE "rooler_rules"."id" = 116  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:47:44 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 129], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 15:45:44 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 130], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 131], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 132], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 135], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 135]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 136], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 137], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 138], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 123 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 124) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 124], ["deliverable_type", "Rooler::Rule"], ["rule_id", 123], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (1.0ms) 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", 123]] Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 124]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.8ms) Date: Thu, 27 Mar 2014 16:56:44 +0100 From: default@myapp.com To: test@email.com Message-ID: <53344a3caa835_4073ff339c34cd8793f@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 15:56:44.711420' WHERE "rooler_deliveries"."id" = 61 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 61]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-18"], ["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 139], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 125]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 125 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 83) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 83], ["deliverable_type", "Foo"], ["rule_id", 125], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.739907' WHERE "rooler_rules"."id" = 125  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 83]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 140], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 126 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 84) LIMIT 1 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", Thu, 27 Mar 2014 15:56:44 UTC +00:00], ["deliverable_id", 84], ["deliverable_type", "Foo"], ["rule_id", 126], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 15:56:44.822449' WHERE "rooler_rules"."id" = 126  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 84 [["active", false], ["updated_at", Thu, 27 Mar 2014 15:56:44 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 126]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (84) [["rule_id", 126]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 63]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (100.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Mar 2014 17:59:26 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 17:59:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (3.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 141], ["updated_at", Thu, 27 Mar 2014 17:59:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (27.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 127 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 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", Thu, 27 Mar 2014 17:59:26 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Rooler::Rule"], ["rule_id", 127], ["updated_at", Thu, 27 Mar 2014 17:59:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 127]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (68.8ms) Sent mail to test_name@to.com (58.1ms) Date: Thu, 27 Mar 2014 18:59:26 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533466ff1b8_25ff3ff09e034cdc694b2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (3.1ms) 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (2.0ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 142], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 143], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 144], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 130]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 130 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 86) LIMIT 1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["deliverable_id", 86], ["deliverable_type", "Foo"], ["rule_id", 130], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.143880' WHERE "rooler_rules"."id" = 130  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 130]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (86)) SQL (2.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.163233' WHERE "rooler_rules"."id" = 130  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (1.8ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (3.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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 145], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 146], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 147], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 132]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 132 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["deliverable_id", 89], ["deliverable_type", "Foo"], ["rule_id", 132], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.301671' WHERE "rooler_rules"."id" = 132 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 133]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 133 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 89) LIMIT 1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["deliverable_id", 89], ["deliverable_type", "Foo"], ["rule_id", 133], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.312361' WHERE "rooler_rules"."id" = 133  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 132]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 132]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (89)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 133]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 133]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 133]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 148], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 134]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 134 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Foo"], ["rule_id", 134], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.350405' WHERE "rooler_rules"."id" = 134  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 134]]  (0.7ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (91))  (0.9ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.0ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 134]] Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (91)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.367715' WHERE "rooler_rules"."id" = 134  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SAVEPOINT active_record_1 SQL (2.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 91 [["active", false], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (3.0ms) SELECT COUNT(*) FROM "rooler_deliveries"  (6.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 134]] Foo Load (2.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (91) [["rule_id", 134]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 68]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 91 [["active", true], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 134]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 134 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 91) LIMIT 1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["deliverable_id", 91], ["deliverable_type", "Foo"], ["rule_id", 134], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:27.424100' WHERE "rooler_rules"."id" = 134  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 17:50:27 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 149], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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-9"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (7.4ms) RELEASE SAVEPOINT active_record_1  (1.6ms) SAVEPOINT active_record_1 SQL (2.3ms) 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 17:48:27 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 150], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (1.5ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (1.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 151], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 152], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) 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())  (0.3ms) ROLLBACK  (0.6ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 155], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 155]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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-15"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 156], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 156]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 157], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 158], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 141 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 142) LIMIT 1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["deliverable_id", 142], ["deliverable_type", "Rooler::Rule"], ["rule_id", 141], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 141]] 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", 142]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (21.6ms) Date: Thu, 27 Mar 2014 18:59:27 +0100 From: default@myapp.com To: test@email.com Message-ID: <533466ffd8abf_25ff3ff09e034cdc695fd@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 17:59:27.906748' WHERE "rooler_deliveries"."id" = 70 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 70]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-18"], ["created_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 159], ["updated_at", Thu, 27 Mar 2014 17:59:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 143]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 143 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 95) LIMIT 1 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", Thu, 27 Mar 2014 17:59:28 UTC +00:00], ["deliverable_id", 95], ["deliverable_type", "Foo"], ["rule_id", 143], ["updated_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:28.018877' WHERE "rooler_rules"."id" = 143  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 95]]  (0.5ms) ROLLBACK  (0.5ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:28 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 17:59:28 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 160], ["updated_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00]]  (0.6ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 144]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 144 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 96) LIMIT 1 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", Thu, 27 Mar 2014 17:59:28 UTC +00:00], ["deliverable_id", 96], ["deliverable_type", "Foo"], ["rule_id", 144], ["updated_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 17:59:28.064792' WHERE "rooler_rules"."id" = 144  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 96 [["active", false], ["updated_at", Thu, 27 Mar 2014 17:59:28 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (2.6ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (2.1ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 144]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (96) [["rule_id", 144]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 72]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (30.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Mar 2014 18:35:05 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 18:35:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:05 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 161], ["updated_at", Thu, 27 Mar 2014 18:35:05 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 145 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 145) LIMIT 1 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", Thu, 27 Mar 2014 18:35:05 UTC +00:00], ["deliverable_id", 145], ["deliverable_type", "Rooler::Rule"], ["rule_id", 145], ["updated_at", Thu, 27 Mar 2014 18:35:05 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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", 145]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.4ms) Sent mail to test_name@to.com (26.7ms) Date: Thu, 27 Mar 2014 19:35:06 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53346f5ad039_30513fea84434cd0284e2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.5ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 162], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 163], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 164], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 148]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 148 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 98) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 98], ["deliverable_type", "Foo"], ["rule_id", 148], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.142553' WHERE "rooler_rules"."id" = 148  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 148]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (98)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.147302' WHERE "rooler_rules"."id" = 148  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 165], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 166], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 167], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 150]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 150 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 101) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 101], ["deliverable_type", "Foo"], ["rule_id", 150], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.212482' WHERE "rooler_rules"."id" = 150 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 151]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 151 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 101) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 101], ["deliverable_type", "Foo"], ["rule_id", 151], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.221510' WHERE "rooler_rules"."id" = 151  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 150]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 150]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (101)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 151]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 151]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 151]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 168], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 152]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 152 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 103], ["deliverable_type", "Foo"], ["rule_id", 152], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.260787' WHERE "rooler_rules"."id" = 152  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 152]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (103))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 152]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (103)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.266286' WHERE "rooler_rules"."id" = 152  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (1.3ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 103 [["active", false], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 152]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (103) [["rule_id", 152]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 77]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 103 [["active", true], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 152]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 152 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 103) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 103], ["deliverable_type", "Foo"], ["rule_id", 152], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.294466' WHERE "rooler_rules"."id" = 152  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 18:26:06 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 169], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 18:24:06 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 170], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 171], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 172], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 175], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 175]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 176], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 176]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 177], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 178], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 159 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 160) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 160], ["deliverable_type", "Rooler::Rule"], ["rule_id", 159], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 159]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 160]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (16.3ms) Date: Thu, 27 Mar 2014 19:35:06 +0100 From: default@myapp.com To: test@email.com Message-ID: <53346f5a81b59_30513fea84434cd0285d1@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 18:35:06.546206' WHERE "rooler_deliveries"."id" = 79 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 79]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 179], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 161]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 161 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 107) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 107], ["deliverable_type", "Foo"], ["rule_id", 161], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.571387' WHERE "rooler_rules"."id" = 161  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 107]]  (0.4ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 180], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 162]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 162 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 108) LIMIT 1 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", Thu, 27 Mar 2014 18:35:06 UTC +00:00], ["deliverable_id", 108], ["deliverable_type", "Foo"], ["rule_id", 162], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:35:06.600464' WHERE "rooler_rules"."id" = 162  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 108 [["active", false], ["updated_at", Thu, 27 Mar 2014 18:35:06 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.2ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 162]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (108) [["rule_id", 162]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 81]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (11.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 181], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 163 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Rooler::Rule"], ["rule_id", 163], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 163]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (42.1ms) Sent mail to test_name@to.com (23.1ms) Date: Thu, 27 Mar 2014 19:52:23 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5334736782819_35473fd6e1434cdc55348@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (2.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 182], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 183], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 184], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 166]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 166 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 110) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 110], ["deliverable_type", "Foo"], ["rule_id", 166], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.629598' WHERE "rooler_rules"."id" = 166  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 166]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (110)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.635716' WHERE "rooler_rules"."id" = 166  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 185], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 186], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-6"], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 187], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 168]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 168 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 113) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 113], ["deliverable_type", "Foo"], ["rule_id", 168], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.688006' WHERE "rooler_rules"."id" = 168 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 169]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 169 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 113) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 113], ["deliverable_type", "Foo"], ["rule_id", 169], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.695452' WHERE "rooler_rules"."id" = 169  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 168]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 168]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (113)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 169]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 169]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 169]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 188], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 170 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 115) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 115], ["deliverable_type", "Foo"], ["rule_id", 170], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.732179' WHERE "rooler_rules"."id" = 170  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]]  (0.2ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (115))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (115)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.737503' WHERE "rooler_rules"."id" = 170  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 115 [["active", false], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (115) [["rule_id", 170]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 86]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 115 [["active", true], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 170]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 170 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 115) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 115], ["deliverable_type", "Foo"], ["rule_id", 170], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:23.761075' WHERE "rooler_rules"."id" = 170  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 18:43:23 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 189], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 18:41:23 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 190], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-10"], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 191], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 192], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 195], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 195]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 196], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 196]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 197], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 198], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 177 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 178) LIMIT 1 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", Thu, 27 Mar 2014 18:52:23 UTC +00:00], ["deliverable_id", 178], ["deliverable_type", "Rooler::Rule"], ["rule_id", 177], ["updated_at", Thu, 27 Mar 2014 18:52:23 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 177]] 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", 178]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (75.8ms) Date: Thu, 27 Mar 2014 19:52:23 +0100 From: default@myapp.com To: test@email.com Message-ID: <53347367eaf89_35473fd6e1434cdc554d1@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.7ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 18:52:24.036692' WHERE "rooler_deliveries"."id" = 88 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 88]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-18"], ["created_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 199], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 179]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 179 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 119) LIMIT 1 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", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["deliverable_id", 119], ["deliverable_type", "Foo"], ["rule_id", 179], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:24.067054' WHERE "rooler_rules"."id" = 179  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 119]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 200], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 180]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 180 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 120) LIMIT 1 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", Thu, 27 Mar 2014 18:52:24 UTC +00:00], ["deliverable_id", 120], ["deliverable_type", "Foo"], ["rule_id", 180], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:52:24.091496' WHERE "rooler_rules"."id" = 180  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 120 [["active", false], ["updated_at", Thu, 27 Mar 2014 18:52:24 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 180]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (120) [["rule_id", 180]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 90]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (9.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 201], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 181 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 181) LIMIT 1 SQL (1.2ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["deliverable_id", 181], ["deliverable_type", "Rooler::Rule"], ["rule_id", 181], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (2.0ms) 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", 181]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (46.3ms) Sent mail to test_name@to.com (25.7ms) Date: Thu, 27 Mar 2014 19:54:56 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53347400c10f4_360a3ffa2c434cdc774d2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 202], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 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-2"], ["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 203], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 204], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 184]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 184 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 122) LIMIT 1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["deliverable_id", 122], ["deliverable_type", "Foo"], ["rule_id", 184], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:56.890462' WHERE "rooler_rules"."id" = 184  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 184]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (122)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:56.894926' WHERE "rooler_rules"."id" = 184  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 205], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 206], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 207], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 186]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 186 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 125) LIMIT 1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["deliverable_id", 125], ["deliverable_type", "Foo"], ["rule_id", 186], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:56.947341' WHERE "rooler_rules"."id" = 186 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 187]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 187 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 125) LIMIT 1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["deliverable_id", 125], ["deliverable_type", "Foo"], ["rule_id", 187], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:56.955769' WHERE "rooler_rules"."id" = 187  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 186]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 186]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (125)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 187]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 187]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 187]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 208], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 188 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 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", Thu, 27 Mar 2014 18:54:56 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Foo"], ["rule_id", 188], ["updated_at", Thu, 27 Mar 2014 18:54:56 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:56.988514' WHERE "rooler_rules"."id" = 188  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]]  (0.6ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (127))  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (127)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:56.997995' WHERE "rooler_rules"."id" = 188  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 127 [["active", false], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (127) [["rule_id", 188]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 95]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 127 [["active", true], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 188]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 188 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 127) LIMIT 1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["deliverable_id", 127], ["deliverable_type", "Foo"], ["rule_id", 188], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:57.026794' WHERE "rooler_rules"."id" = 188  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 18:45:57 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 209], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 18:43:57 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 210], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-10"], ["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 211], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 212], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 215], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 215]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 216], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 216]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 217], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 218], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 195 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 196) LIMIT 1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["deliverable_id", 196], ["deliverable_type", "Rooler::Rule"], ["rule_id", 195], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 195]] 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", 196]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (16.1ms) Date: Thu, 27 Mar 2014 19:54:57 +0100 From: default@myapp.com To: test@email.com Message-ID: <533474013ca06_360a3ffa2c434cdc77559@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 18:54:57.261996' WHERE "rooler_deliveries"."id" = 97 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 97]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 219], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 197]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 197 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 131) LIMIT 1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["deliverable_id", 131], ["deliverable_type", "Foo"], ["rule_id", 197], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:57.290679' WHERE "rooler_rules"."id" = 197  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 131]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 220], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 198]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 198 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 132) LIMIT 1 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", Thu, 27 Mar 2014 18:54:57 UTC +00:00], ["deliverable_id", 132], ["deliverable_type", "Foo"], ["rule_id", 198], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 18:54:57.313195' WHERE "rooler_rules"."id" = 198  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 132 [["active", false], ["updated_at", Thu, 27 Mar 2014 18:54:57 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.2ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 198]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (132) [["rule_id", 198]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 99]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (38.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 221], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.1ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 199 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Rooler::Rule"], ["rule_id", 199], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.4ms) 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", 199]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (60.4ms) Sent mail to test_name@to.com (44.1ms) Date: Thu, 27 Mar 2014 20:30:26 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53347c52b9a36_40c43fd9dd434cd8334cd@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 222], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 223], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 224], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 202]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 202 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 134) LIMIT 1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["deliverable_id", 134], ["deliverable_type", "Foo"], ["rule_id", 202], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:26.854917' WHERE "rooler_rules"."id" = 202  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 202]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (134)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:26.859140' WHERE "rooler_rules"."id" = 202  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 225], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 226], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 227], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 204]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 204 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 137) LIMIT 1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["deliverable_id", 137], ["deliverable_type", "Foo"], ["rule_id", 204], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:26.941212' WHERE "rooler_rules"."id" = 204 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 205 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 137) LIMIT 1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["deliverable_id", 137], ["deliverable_type", "Foo"], ["rule_id", 205], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:26.949974' WHERE "rooler_rules"."id" = 205  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 204]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 204]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (137)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 205]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 205]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 228], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 139) LIMIT 1 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", Thu, 27 Mar 2014 19:30:26 UTC +00:00], ["deliverable_id", 139], ["deliverable_type", "Foo"], ["rule_id", 206], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:26.980215' WHERE "rooler_rules"."id" = 206  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (139))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (139)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:26.985510' WHERE "rooler_rules"."id" = 206  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 139 [["active", false], ["updated_at", Thu, 27 Mar 2014 19:30:26 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (139) [["rule_id", 206]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 104]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 139 [["active", true], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 206]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 206 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 139) LIMIT 1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["deliverable_id", 139], ["deliverable_type", "Foo"], ["rule_id", 206], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:27.018332' WHERE "rooler_rules"."id" = 206  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 19:21:27 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 229], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Thu, 27 Mar 2014 19:19:27 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 230], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 231], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 232], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 235], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 235]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 236], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 236]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 237], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-17"], ["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 238], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 213 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 214) LIMIT 1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["deliverable_id", 214], ["deliverable_type", "Rooler::Rule"], ["rule_id", 213], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 213]] 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", 214]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (19.7ms) Date: Thu, 27 Mar 2014 20:30:27 +0100 From: default@myapp.com To: test@email.com Message-ID: <53347c5348267_40c43fd9dd434cd833565@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-27 19:30:27.313532' WHERE "rooler_deliveries"."id" = 106 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 106]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 239], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 215]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 215 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 143) LIMIT 1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["deliverable_id", 143], ["deliverable_type", "Foo"], ["rule_id", 215], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:27.342658' WHERE "rooler_rules"."id" = 215  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 143]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 240], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 216]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 216 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 144) LIMIT 1 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", Thu, 27 Mar 2014 19:30:27 UTC +00:00], ["deliverable_id", 144], ["deliverable_type", "Foo"], ["rule_id", 216], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-27 19:30:27.366810' WHERE "rooler_rules"."id" = 216  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 144 [["active", false], ["updated_at", Thu, 27 Mar 2014 19:30:27 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 216]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (144) [["rule_id", 216]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 108]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (78.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 241], ["updated_at", Fri, 28 Mar 2014 11:18:57 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (24.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 217 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 217) LIMIT 1 SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 217], ["deliverable_type", "Rooler::Rule"], ["rule_id", 217], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.2ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 217]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (51.5ms) Sent mail to test_name@to.com (57.6ms) Date: Fri, 28 Mar 2014 12:18:58 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53355aa27b88b_1323880434ce0169cd@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 242], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 243], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 244], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (5.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (1.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (5.2ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 220 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 146) LIMIT 1 SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 146], ["deliverable_type", "Foo"], ["rule_id", 220], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.5ms) RELEASE SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.712565' WHERE "rooler_rules"."id" = 220  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (1.9ms) SELECT COUNT(*) FROM "rooler_deliveries"  (4.1ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 220]] Foo Load (1.1ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (146)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.746418' WHERE "rooler_rules"."id" = 220  (2.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (6.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.9ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1  (2.9ms) SAVEPOINT active_record_1 SQL (3.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (1.2ms) RELEASE SAVEPOINT active_record_1  (3.7ms) SAVEPOINT active_record_1 SQL (4.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (1.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 245], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 246], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 247], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 222 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 222], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.894200' WHERE "rooler_rules"."id" = 222 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 223]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 223 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 149) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 149], ["deliverable_type", "Foo"], ["rule_id", 223], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.904883' WHERE "rooler_rules"."id" = 223  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 222]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 222]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (149)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 223]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 223]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 223]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 248], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 224 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Foo"], ["rule_id", 224], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.948269' WHERE "rooler_rules"."id" = 224  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (151))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (151)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.953878' WHERE "rooler_rules"."id" = 224  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 151 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (151) [["rule_id", 224]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 113]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 151 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 224]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 224 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 151) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["deliverable_id", 151], ["deliverable_type", "Foo"], ["rule_id", 224], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:58.981345' WHERE "rooler_rules"."id" = 224  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:09:58 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 249], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:58 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:07:58 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 250], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 251], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 252], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 255], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 255]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 256], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 256]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 257], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 258], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 231 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 232) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["deliverable_id", 232], ["deliverable_type", "Rooler::Rule"], ["rule_id", 231], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.7ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 231]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 232]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (18.1ms) Date: Fri, 28 Mar 2014 12:18:59 +0100 From: default@myapp.com To: test@email.com Message-ID: <53355aa36ec09_1323880434ce01705b@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:18:59.467529' WHERE "rooler_deliveries"."id" = 115 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 115]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 259], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 233]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 233 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 155) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["deliverable_id", 155], ["deliverable_type", "Foo"], ["rule_id", 233], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:59.494097' WHERE "rooler_rules"."id" = 233  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 155]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 260], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 234]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 234 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 156) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00], ["deliverable_id", 156], ["deliverable_type", "Foo"], ["rule_id", 234], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:18:59.521909' WHERE "rooler_rules"."id" = 234  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 156 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:18:59 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 234]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (156) [["rule_id", 234]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 117]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (23.2ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 261], ["updated_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 235 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1 SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Rooler::Rule"], ["rule_id", 235], ["updated_at", Fri, 28 Mar 2014 11:43:54 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.3ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 235]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (48.3ms) Sent mail to test_name@to.com (28.5ms) Date: Fri, 28 Mar 2014 12:43:55 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335607b21ac9_139963fd09c834cd895711@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 262], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 263], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 264], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.9ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 238 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 158) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 158], ["deliverable_type", "Foo"], ["rule_id", 238], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.239650' WHERE "rooler_rules"."id" = 238  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 238]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (158)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.245531' WHERE "rooler_rules"."id" = 238  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 265], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 266], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 267], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 240]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 240 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 161) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 161], ["deliverable_type", "Foo"], ["rule_id", 240], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.322129' WHERE "rooler_rules"."id" = 240 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 241]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 241 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 161) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 161], ["deliverable_type", "Foo"], ["rule_id", 241], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.330357' WHERE "rooler_rules"."id" = 241  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 240]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 240]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (161)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 241]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 241]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 241]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 268], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Foo"], ["rule_id", 242], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.364610' WHERE "rooler_rules"."id" = 242  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (163))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (163)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.373855' WHERE "rooler_rules"."id" = 242  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 163 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (163) [["rule_id", 242]]  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 122]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 163 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 242]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 242 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 163) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 163], ["deliverable_type", "Foo"], ["rule_id", 242], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.402911' WHERE "rooler_rules"."id" = 242  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:34:55 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 269], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:32:55 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 270], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 271], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 272], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 275], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 275]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 276], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 276]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.5ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (1.0ms) SAVEPOINT active_record_1 SQL (1.3ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 277], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.7ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 278], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 249 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 250) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 250], ["deliverable_type", "Rooler::Rule"], ["rule_id", 249], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 249]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 250]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.9ms) Sent mail to test@email.com (23.4ms) Date: Fri, 28 Mar 2014 12:43:55 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335607be012c_139963fd09c834cd8958b9@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (1.2ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:43:55.938742' WHERE "rooler_deliveries"."id" = 124 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 124]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (2.2ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 279], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 251]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 251 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 167) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00], ["deliverable_id", 167], ["deliverable_type", "Foo"], ["rule_id", 251], ["updated_at", Fri, 28 Mar 2014 11:43:55 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:55.988099' WHERE "rooler_rules"."id" = 251  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (1.0ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (1.0ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 167]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.8ms) SAVEPOINT active_record_1 SQL (2.1ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]  (0.9ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 280], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 252]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 252 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 168) LIMIT 1 SQL (1.0ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00], ["deliverable_id", 168], ["deliverable_type", "Foo"], ["rule_id", 252], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:43:56.037789' WHERE "rooler_rules"."id" = 252  (0.5ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 168 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:43:56 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 252]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (168) [["rule_id", 252]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 126]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (8.1ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 281], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 253 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 253) LIMIT 1 SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 253], ["deliverable_type", "Rooler::Rule"], ["rule_id", 253], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.2ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 253]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.5ms) Sent mail to test_name@to.com (25.9ms) Date: Fri, 28 Mar 2014 12:45:46 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533560ea73aeb_13a183fe430434cd060757@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 282], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 283], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 284], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 256 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 170) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 170], ["deliverable_type", "Foo"], ["rule_id", 256], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.558663' WHERE "rooler_rules"."id" = 256  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 256]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (170)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.563517' WHERE "rooler_rules"."id" = 256  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 285], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 286], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 287], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 258]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 258 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Foo"], ["rule_id", 258], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.611199' WHERE "rooler_rules"."id" = 258 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 259]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 259 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 173) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 173], ["deliverable_type", "Foo"], ["rule_id", 259], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.618573' WHERE "rooler_rules"."id" = 259  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 258]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 258]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (173)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 259]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 259]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 259]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 288], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 260 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 175) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 175], ["deliverable_type", "Foo"], ["rule_id", 260], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.649687' WHERE "rooler_rules"."id" = 260  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (175))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (175)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.655407' WHERE "rooler_rules"."id" = 260  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 175 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (175) [["rule_id", 260]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 131]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 175 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 260]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 260 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 175) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 175], ["deliverable_type", "Foo"], ["rule_id", 260], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.679990' WHERE "rooler_rules"."id" = 260  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:36:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 289], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:34:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 290], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 291], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 292], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 295], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 295]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 296], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 296]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 297], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 298], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 267 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 268) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 268], ["deliverable_type", "Rooler::Rule"], ["rule_id", 267], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.9ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 267]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 268]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (13.8ms) Date: Fri, 28 Mar 2014 12:45:46 +0100 From: default@myapp.com To: test@email.com Message-ID: <533560eade25c_13a183fe430434cd060866@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:45:46.921996' WHERE "rooler_deliveries"."id" = 133 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 133]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 299], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 269]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 269 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 179) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 179], ["deliverable_type", "Foo"], ["rule_id", 269], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.946704' WHERE "rooler_rules"."id" = 269  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 179]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 300], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 270 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 180) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00], ["deliverable_id", 180], ["deliverable_type", "Foo"], ["rule_id", 270], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:45:46.970670' WHERE "rooler_rules"."id" = 270  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 180 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:45:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 270]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (180) [["rule_id", 270]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 135]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 301], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.8ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 271 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 271) LIMIT 1 SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 271], ["deliverable_type", "Rooler::Rule"], ["rule_id", 271], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 271]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.5ms) Sent mail to test_name@to.com (25.5ms) Date: Fri, 28 Mar 2014 12:47:46 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335616269c8d_13a9d3fc685434cd04003@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 302], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 303], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 304], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 274]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 274 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 182) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 182], ["deliverable_type", "Foo"], ["rule_id", 274], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.519217' WHERE "rooler_rules"."id" = 274  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 274]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (182)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.523870' WHERE "rooler_rules"."id" = 274  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 305], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 306], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 307], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 276]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 276 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 276], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.567332' WHERE "rooler_rules"."id" = 276 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 277]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 277 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 185) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 185], ["deliverable_type", "Foo"], ["rule_id", 277], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.574426' WHERE "rooler_rules"."id" = 277  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 276]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 276]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (185)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 277]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 277]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 277]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 308], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 187) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 187], ["deliverable_type", "Foo"], ["rule_id", 278], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.606902' WHERE "rooler_rules"."id" = 278  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (187))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (187)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.612331' WHERE "rooler_rules"."id" = 278  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 187 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (187) [["rule_id", 278]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 140]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 187 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 278]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 278 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 187) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 187], ["deliverable_type", "Foo"], ["rule_id", 278], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.642335' WHERE "rooler_rules"."id" = 278  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:38:46 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 309], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:36:46 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 310], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 311], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 312], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 315], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 315]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 316], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 316]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 317], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 318], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 285 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 286) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 286], ["deliverable_type", "Rooler::Rule"], ["rule_id", 285], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 285]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 286]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.1ms) Date: Fri, 28 Mar 2014 12:47:46 +0100 From: default@myapp.com To: test@email.com Message-ID: <53356162ccb52_13a9d3fc685434cd040188@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:47:46.850027' WHERE "rooler_deliveries"."id" = 142 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 142]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 319], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 287]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 287 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 191) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 191], ["deliverable_type", "Foo"], ["rule_id", 287], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.875440' WHERE "rooler_rules"."id" = 287  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 191]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 320], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 288]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 288 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 192) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00], ["deliverable_id", 192], ["deliverable_type", "Foo"], ["rule_id", 288], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:47:46.899568' WHERE "rooler_rules"."id" = 288  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 192 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:47:46 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 288]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (192) [["rule_id", 288]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 144]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 321], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 289 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 289) LIMIT 1 SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["deliverable_id", 289], ["deliverable_type", "Rooler::Rule"], ["rule_id", 289], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.2ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 289]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (57.3ms) Sent mail to test_name@to.com (36.5ms) Date: Fri, 28 Mar 2014 12:48:14 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335617ee7d74_13ac23fc645834cd0906bd@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 322], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 323], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 324], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 292]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 292 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 194) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 194], ["deliverable_type", "Foo"], ["rule_id", 292], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.059458' WHERE "rooler_rules"."id" = 292  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 292]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (194)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.063979' WHERE "rooler_rules"."id" = 292  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 325], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 326], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 327], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 294]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 294 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Foo"], ["rule_id", 294], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.108104' WHERE "rooler_rules"."id" = 294 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 295 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 197) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 197], ["deliverable_type", "Foo"], ["rule_id", 295], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.115331' WHERE "rooler_rules"."id" = 295  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 294]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 294]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (197)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 295]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 295]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 328], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 296 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Foo"], ["rule_id", 296], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.146946' WHERE "rooler_rules"."id" = 296  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (199))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (199)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.153330' WHERE "rooler_rules"."id" = 296  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 199 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (199) [["rule_id", 296]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 149]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 199 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 296]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 296 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 199) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 199], ["deliverable_type", "Foo"], ["rule_id", 296], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.177289' WHERE "rooler_rules"."id" = 296  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:39:15 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 329], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:37:15 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 330], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 331], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 332], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 335], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 335]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 336], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 336]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 337], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 338], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 303 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 304) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 304], ["deliverable_type", "Rooler::Rule"], ["rule_id", 303], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 303]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 304]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.2ms) Date: Fri, 28 Mar 2014 12:48:15 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335617f632ee_13ac23fc645834cd09073@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:48:15.417760' WHERE "rooler_deliveries"."id" = 151 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 151]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 339], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 305]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 305 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 203) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 203], ["deliverable_type", "Foo"], ["rule_id", 305], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.442186' WHERE "rooler_rules"."id" = 305  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 203]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 340], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 306]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 306 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 204) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00], ["deliverable_id", 204], ["deliverable_type", "Foo"], ["rule_id", 306], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:48:15.465862' WHERE "rooler_rules"."id" = 306  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 204 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:48:15 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 306]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (204) [["rule_id", 306]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 153]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (8.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 341], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 307 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 307) LIMIT 1 SQL (0.9ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 307], ["deliverable_type", "Rooler::Rule"], ["rule_id", 307], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.3ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 307]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (45.7ms) Sent mail to test_name@to.com (27.1ms) Date: Fri, 28 Mar 2014 12:52:18 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53356272a40ab_13be83fc471434cdc24073@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 342], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 343], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 344], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 310]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 310 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 206) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 206], ["deliverable_type", "Foo"], ["rule_id", 310], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.756519' WHERE "rooler_rules"."id" = 310  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 310]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (206)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.761257' WHERE "rooler_rules"."id" = 310  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 345], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 346], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 347], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 312]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 312 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 209) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 209], ["deliverable_type", "Foo"], ["rule_id", 312], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.813687' WHERE "rooler_rules"."id" = 312 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 313 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 209) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 209], ["deliverable_type", "Foo"], ["rule_id", 313], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.820824' WHERE "rooler_rules"."id" = 313  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 312]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 312]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (209)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 313]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 313]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 348], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 314 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Foo"], ["rule_id", 314], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.850552' WHERE "rooler_rules"."id" = 314  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (211))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (211)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.855949' WHERE "rooler_rules"."id" = 314  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 211 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (211) [["rule_id", 314]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 158]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 211 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 314]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 314 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 211) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["deliverable_id", 211], ["deliverable_type", "Foo"], ["rule_id", 314], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:18.881769' WHERE "rooler_rules"."id" = 314  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:43:18 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 349], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:41:18 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 350], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 351], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 352], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 355], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 355]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 356], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 356]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 357], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:18 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 358], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 321 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 322) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["deliverable_id", 322], ["deliverable_type", "Rooler::Rule"], ["rule_id", 321], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 321]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 322]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.0ms) Date: Fri, 28 Mar 2014 12:52:19 +0100 From: default@myapp.com To: test@email.com Message-ID: <53356273120d3_13be83fc471434cdc24132@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:52:19.085448' WHERE "rooler_deliveries"."id" = 160 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 160]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 359], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 323]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 323 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 215) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["deliverable_id", 215], ["deliverable_type", "Foo"], ["rule_id", 323], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:19.109646' WHERE "rooler_rules"."id" = 323  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 215]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 360], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 324]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 324 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 216) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00], ["deliverable_id", 216], ["deliverable_type", "Foo"], ["rule_id", 324], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:52:19.133903' WHERE "rooler_rules"."id" = 324  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 216 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:52:19 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 324]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (216) [["rule_id", 324]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 162]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.7ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 361], ["updated_at", Fri, 28 Mar 2014 11:53:13 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 325 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 325) LIMIT 1 SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 325], ["deliverable_type", "Rooler::Rule"], ["rule_id", 325], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 325]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (43.7ms) Sent mail to test_name@to.com (24.7ms) Date: Fri, 28 Mar 2014 12:53:14 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533562aa3157b_13c293fd5bd834cd0537dc@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 362], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 363], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 364], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 328]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 328 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 218) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 218], ["deliverable_type", "Foo"], ["rule_id", 328], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.286515' WHERE "rooler_rules"."id" = 328  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 328]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (218)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.291693' WHERE "rooler_rules"."id" = 328  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 365], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 366], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 367], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 330]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 330 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Foo"], ["rule_id", 330], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.335322' WHERE "rooler_rules"."id" = 330 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 331 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 221) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 221], ["deliverable_type", "Foo"], ["rule_id", 331], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.342684' WHERE "rooler_rules"."id" = 331  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 330]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 330]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (221)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 331]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 331]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 368], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 332 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 223) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 223], ["deliverable_type", "Foo"], ["rule_id", 332], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.372240' WHERE "rooler_rules"."id" = 332  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (223))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (223)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.377584' WHERE "rooler_rules"."id" = 332  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 223 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (223) [["rule_id", 332]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 167]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 223 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 332]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 332 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 223) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 223], ["deliverable_type", "Foo"], ["rule_id", 332], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.406577' WHERE "rooler_rules"."id" = 332  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:44:14 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 369], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:42:14 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 370], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 371], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 372], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 375], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 375]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 376], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 376]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 377], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 378], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 339 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 340) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 340], ["deliverable_type", "Rooler::Rule"], ["rule_id", 339], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.6ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 339]] Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 340]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.1ms) Date: Fri, 28 Mar 2014 12:53:14 +0100 From: default@myapp.com To: test@email.com Message-ID: <533562aa9f90e_13c293fd5bd834cd0538b0@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:53:14.665081' WHERE "rooler_deliveries"."id" = 169 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 169]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 379], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 341]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 341 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 227) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 227], ["deliverable_type", "Foo"], ["rule_id", 341], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.689202' WHERE "rooler_rules"."id" = 341  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 227]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 380], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 342 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 228) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00], ["deliverable_id", 228], ["deliverable_type", "Foo"], ["rule_id", 342], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:14.713589' WHERE "rooler_rules"."id" = 342  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 228 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:14 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 342]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (228) [["rule_id", 342]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 171]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (6.4ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 381], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 343 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 343) LIMIT 1 SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 343], ["deliverable_type", "Rooler::Rule"], ["rule_id", 343], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 343]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.1ms) Sent mail to test_name@to.com (25.8ms) Date: Fri, 28 Mar 2014 12:53:36 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533562c05d08a_13c483fe8ddc34cd014640@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 382], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 383], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 384], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 346]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 346 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 230) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 230], ["deliverable_type", "Foo"], ["rule_id", 346], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.469147' WHERE "rooler_rules"."id" = 346  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 346]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (230)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.474422' WHERE "rooler_rules"."id" = 346  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 385], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 386], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 387], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 348]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 348 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 233) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 233], ["deliverable_type", "Foo"], ["rule_id", 348], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.528462' WHERE "rooler_rules"."id" = 348 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 349 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 233) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 233], ["deliverable_type", "Foo"], ["rule_id", 349], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.535674' WHERE "rooler_rules"."id" = 349  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 348]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 348]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (233)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 349]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 349]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 388], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 350 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Foo"], ["rule_id", 350], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.568427' WHERE "rooler_rules"."id" = 350  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (235))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (235)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.574270' WHERE "rooler_rules"."id" = 350  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.1ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 235 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (235) [["rule_id", 350]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 176]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 235 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 350]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 350 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 235) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 235], ["deliverable_type", "Foo"], ["rule_id", 350], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.599357' WHERE "rooler_rules"."id" = 350  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:44:36 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 389], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:42:36 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 390], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 391], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 392], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.0ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 395], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 395]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 396], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 396]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 397], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 398], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 357 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 358) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 358], ["deliverable_type", "Rooler::Rule"], ["rule_id", 357], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 357]] Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 358]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.9ms) Date: Fri, 28 Mar 2014 12:53:36 +0100 From: default@myapp.com To: test@email.com Message-ID: <533562c0d50c9_13c483fe8ddc34cd014736@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:53:36.884787' WHERE "rooler_deliveries"."id" = 178 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 178]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 399], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 359]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 359 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 239) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 239], ["deliverable_type", "Foo"], ["rule_id", 359], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.914577' WHERE "rooler_rules"."id" = 359  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 239]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 400], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 360]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 360 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 240) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00], ["deliverable_id", 240], ["deliverable_type", "Foo"], ["rule_id", 360], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:53:36.940214' WHERE "rooler_rules"."id" = 360  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 240 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:53:36 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 360]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (240) [["rule_id", 360]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 180]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (23.3ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 401], ["updated_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 361 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 361) LIMIT 1 SQL (0.8ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00], ["deliverable_id", 361], ["deliverable_type", "Rooler::Rule"], ["rule_id", 361], ["updated_at", Fri, 28 Mar 2014 11:56:37 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.1ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 361]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (44.9ms) Sent mail to test_name@to.com (27.4ms) Date: Fri, 28 Mar 2014 12:56:38 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <533563762d76_13d083fe918c34ce0865e2@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 402], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 403], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 404], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 364]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 364 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 242) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 242], ["deliverable_type", "Foo"], ["rule_id", 364], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.097952' WHERE "rooler_rules"."id" = 364  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 364]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (242)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.102819' WHERE "rooler_rules"."id" = 364  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-4"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 405], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 406], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 407], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 366 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 245) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 245], ["deliverable_type", "Foo"], ["rule_id", 366], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.175286' WHERE "rooler_rules"."id" = 366 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 367 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 245) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 245], ["deliverable_type", "Foo"], ["rule_id", 367], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.186389' WHERE "rooler_rules"."id" = 367  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 366]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 366]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (245)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 367]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 367]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 408], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 368 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 247) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 247], ["deliverable_type", "Foo"], ["rule_id", 368], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.233790' WHERE "rooler_rules"."id" = 368  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (247))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (247)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.243238' WHERE "rooler_rules"."id" = 368  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 247 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (247) [["rule_id", 368]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 185]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 247 [["active", true], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 368]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 368 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 247) LIMIT 1 SQL (0.7ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 247], ["deliverable_type", "Foo"], ["rule_id", 368], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.276805' WHERE "rooler_rules"."id" = 368  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:47:38 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 409], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 11:45:38 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 410], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 411], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-11"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 412], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 415], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 415]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-15"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 416], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 416]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-16"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 417], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-17"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 418], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 375 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 376) LIMIT 1 SQL (0.5ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 376], ["deliverable_type", "Rooler::Rule"], ["rule_id", 375], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.5ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 375]] Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 376]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (13.4ms) Date: Fri, 28 Mar 2014 12:56:38 +0100 From: default@myapp.com To: test@email.com Message-ID: <533563768dc72_13d083fe918c34ce08668@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 11:56:38.592529' WHERE "rooler_deliveries"."id" = 187 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 187]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 60], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 419], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 377]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 377 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 251) LIMIT 1 SQL (0.6ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 251], ["deliverable_type", "Foo"], ["rule_id", 377], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.620222' WHERE "rooler_rules"."id" = 377  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 251]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 420], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 378]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 378 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 252) LIMIT 1 SQL (0.4ms) INSERT INTO "rooler_deliveries" ("created_at", "deliverable_id", "deliverable_type", "rule_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["created_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00], ["deliverable_id", 252], ["deliverable_type", "Foo"], ["rule_id", 378], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 11:56:38.646127' WHERE "rooler_rules"."id" = 378  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 252 [["active", false], ["updated_at", Fri, 28 Mar 2014 11:56:38 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.2ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 378]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (252) [["rule_id", 378]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 189]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (18.8ms) Sent mail to test_name@to.com (84.7ms) Date: Fri, 28 Mar 2014 17:27:39 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335a2fb73cd3_186683ff042034cd4779e9@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.573393' WHERE "rooler_rules"."id" = 382  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 382]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (254)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.577950' WHERE "rooler_rules"."id" = 382  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.2ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.646057' WHERE "rooler_rules"."id" = 384 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 385]]  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.653331' WHERE "rooler_rules"."id" = 385  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 384]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 384]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (257)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 385]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 385]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 385]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.3ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.688961' WHERE "rooler_rules"."id" = 386  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (259))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (259)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.695937' WHERE "rooler_rules"."id" = 386  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 194]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 386]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:27:39.719343' WHERE "rooler_rules"."id" = 386  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 435]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 436]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.5ms) Sent mail to test_name@to.com (83.1ms) Date: Fri, 28 Mar 2014 17:29:17 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335a35d47a91_983fd521c34cdc31888@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.385541' WHERE "rooler_rules"."id" = 396  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 396]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (264)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.390709' WHERE "rooler_rules"."id" = 396  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.445821' WHERE "rooler_rules"."id" = 398 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.453266' WHERE "rooler_rules"."id" = 399  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 398]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 398]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (267)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 399]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 399]]  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.488740' WHERE "rooler_rules"."id" = 400  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (269))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (269)) SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.494983' WHERE "rooler_rules"."id" = 400  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 200]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 400]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.524576' WHERE "rooler_rules"."id" = 400  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 451]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 452]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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]] 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.9ms) Date: Fri, 28 Mar 2014 17:29:17 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335a35dbb932_983fd521c34cdc319dc@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:29:17.781247' WHERE "rooler_deliveries"."id" = 202 Rooler::Delivery Load (0.9ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 202]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 409]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.861255' WHERE "rooler_rules"."id" = 409  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 273]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 410]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:29:17.888827' WHERE "rooler_rules"."id" = 410  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 410]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 204]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (4.2ms) Sent mail to test_name@to.com (96.0ms) Date: Fri, 28 Mar 2014 17:31:04 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335a3c8c58df_1423fef88434ce0829fc@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 414]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.902590' WHERE "rooler_rules"."id" = 414  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 414]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (276)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.909273' WHERE "rooler_rules"."id" = 414  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.981176' WHERE "rooler_rules"."id" = 416 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:04.990216' WHERE "rooler_rules"."id" = 417  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 416]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 416]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (279)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 417]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 417]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.023153' WHERE "rooler_rules"."id" = 418  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (281))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (281)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.028308' WHERE "rooler_rules"."id" = 418  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 209]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 418]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.059034' WHERE "rooler_rules"."id" = 418  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 471]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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]] 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (16.8ms) Date: Fri, 28 Mar 2014 17:31:05 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335a3c94813a_1423fef88434ce083042@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:31:05.308741' WHERE "rooler_deliveries"."id" = 211 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 211]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 427]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.333237' WHERE "rooler_rules"."id" = 427  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 285]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (58.9ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 428]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:05.421263' WHERE "rooler_rules"."id" = 428  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 428]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 213]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (10.4ms) Sent mail to test_name@to.com (77.4ms) Date: Fri, 28 Mar 2014 17:31:31 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335a3e3b3288_1643fe1cdc34cd854011@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.866416' WHERE "rooler_rules"."id" = 432  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 432]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (288)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.870753' WHERE "rooler_rules"."id" = 432  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.923491' WHERE "rooler_rules"."id" = 434 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 435]]  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.930649' WHERE "rooler_rules"."id" = 435  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 434]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 434]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (291)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 435]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 435]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 435]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.960857' WHERE "rooler_rules"."id" = 436  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (293))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (293)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.966421' WHERE "rooler_rules"."id" = 436  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 218]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 436]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:31.990331' WHERE "rooler_rules"."id" = 436  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 491]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 492]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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]] 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (18.2ms) Date: Fri, 28 Mar 2014 17:31:32 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335a3e4a2e5c_1643fe1cdc34cd854140@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:31:32.683865' WHERE "rooler_deliveries"."id" = 220 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 220]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 445]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:32.710729' WHERE "rooler_rules"."id" = 445  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 297]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 446]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:31:32.735424' WHERE "rooler_rules"."id" = 446  (0.3ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 446]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 222]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.4ms) Sent mail to test_name@to.com (67.5ms) Date: Fri, 28 Mar 2014 17:32:13 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335a40d1b835_1a93fc77d034ce02239@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.3ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.8ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.208556' WHERE "rooler_rules"."id" = 450  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 450]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (300)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.212778' WHERE "rooler_rules"."id" = 450  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 452]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.258970' WHERE "rooler_rules"."id" = 452 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]]  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.269389' WHERE "rooler_rules"."id" = 453  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 452]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 452]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (303)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 453]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 453]]  (0.3ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.304845' WHERE "rooler_rules"."id" = 454  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]]  (0.2ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (305))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (305)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.311673' WHERE "rooler_rules"."id" = 454  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 227]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 454]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.339519' WHERE "rooler_rules"."id" = 454  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.3ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.3ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 511]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 512]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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]] 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.4ms) Sent mail to test@email.com (19.0ms) Date: Fri, 28 Mar 2014 17:32:13 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335a40d9877c_1a93fc77d034ce022431@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:32:13.641816' WHERE "rooler_deliveries"."id" = 229 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 229]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 463]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.671078' WHERE "rooler_rules"."id" = 463  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 309]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:32:13.694928' WHERE "rooler_rules"."id" = 464  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 464]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 231]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (5.2ms) Sent mail to test_name@to.com (72.2ms) Date: Fri, 28 Mar 2014 17:34:54 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335a4aed3dd7_2853ff744c34cd8989f4@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:54.962469' WHERE "rooler_rules"."id" = 468  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 468]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (312)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:54.969427' WHERE "rooler_rules"."id" = 468  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 470]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.017810' WHERE "rooler_rules"."id" = 470 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 471]]  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.025751' WHERE "rooler_rules"."id" = 471  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 470]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 470]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (315)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 471]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 471]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 471]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.056291' WHERE "rooler_rules"."id" = 472  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]]  (0.2ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (317))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (317)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.061477' WHERE "rooler_rules"."id" = 472  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 236]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 472]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.088719' WHERE "rooler_rules"."id" = 472  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.2ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.1ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 531]] Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 532]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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]] 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (15.8ms) Date: Fri, 28 Mar 2014 17:34:55 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335a4af58b30_2853ff744c34cd8990be@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.3ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 16:34:55.377513' WHERE "rooler_deliveries"."id" = 238 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 238]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 481]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.407595' WHERE "rooler_rules"."id" = 481  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 321]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 482]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 16:34:55.437783' WHERE "rooler_rules"."id" = 482  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 482]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 240]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.5ms) Sent mail to test_name@to.com (74.4ms) Date: Fri, 28 Mar 2014 18:00:15 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335aa9fe3d19_9af3fd3b1c34cd0906f1@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 486]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.045744' WHERE "rooler_rules"."id" = 486  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 486]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (324)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.050864' WHERE "rooler_rules"."id" = 486  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 488]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.093730' WHERE "rooler_rules"."id" = 488 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]]  (0.2ms) SAVEPOINT active_record_1 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 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.104519' WHERE "rooler_rules"."id" = 489  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 488]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 488]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (327)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 489]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 489]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.139270' WHERE "rooler_rules"."id" = 490  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (329))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (329)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.144661' WHERE "rooler_rules"."id" = 490  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 245]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 490]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.172882' WHERE "rooler_rules"."id" = 490  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 551]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.4ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 552]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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]] 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]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (14.1ms) Date: Fri, 28 Mar 2014 18:00:16 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335aaa075104_9af3fd3b1c34cd090794@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.5ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 17:00:16.492084' WHERE "rooler_deliveries"."id" = 247 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 247]]  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 499]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.522610' WHERE "rooler_rules"."id" = 499  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 333]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 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 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 17:00:16.545752' WHERE "rooler_rules"."id" = 500  (0.1ms) SAVEPOINT active_record_1 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]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 500]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' 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]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 249]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (65.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 19:39:47 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Fri, 28 Mar 2014 19:39:47 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.6ms) INSERT INTO "rooler_rules" ("created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:47 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 557], ["updated_at", Fri, 28 Mar 2014 19:39:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (83.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 501 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 501) LIMIT 1 SQL (1.1ms) 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 19:39:47 UTC +00:00], ["deliverable_id", 501], ["deliverable_type", "Rooler::Rule"], ["rule_id", 501], ["updated_at", Fri, 28 Mar 2014 19:39:47 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 501]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (12.5ms) Sent mail to test_name@to.com (109.3ms) Date: Fri, 28 Mar 2014 20:39:47 +0100 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <5335d003ea929_36133fce0d434cdc2325@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 558], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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-2"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 559], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 560], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 504]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 504 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 336) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 336], ["deliverable_type", "Foo"], ["rule_id", 504], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.154188' WHERE "rooler_rules"."id" = 504  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 504]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (336)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.160801' WHERE "rooler_rules"."id" = 504  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 561], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 562], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 563], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 506]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 506 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 339) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 339], ["deliverable_type", "Foo"], ["rule_id", 506], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.262871' WHERE "rooler_rules"."id" = 506 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 507 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 339) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 339], ["deliverable_type", "Foo"], ["rule_id", 507], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.272681' WHERE "rooler_rules"."id" = 507  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 506]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 506]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (339)) Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 507]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 507]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 564], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 508]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 508 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 341) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 341], ["deliverable_type", "Foo"], ["rule_id", 508], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.317264' WHERE "rooler_rules"."id" = 508  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 508]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (341))  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 508]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (341)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.326038' WHERE "rooler_rules"."id" = 508  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 341 [["active", false], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 508]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (341) [["rule_id", 508]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 254]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 341 [["active", true], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 508]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 508 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 341) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 341], ["deliverable_type", "Foo"], ["rule_id", 508], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.360252' WHERE "rooler_rules"."id" = 508  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 19:30:48 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 565], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Fri, 28 Mar 2014 19:28:48 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 566], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.9ms) 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 567], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 568], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE (last_checked_at IS NULL OR check_frequency IS NULL OR (last_checked_at + check_frequency*'1 second'::interval) < now())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 571], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 571]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) 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 19:39:48 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 572], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.9ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 572]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (1.1ms) 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 19:39:48 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 573], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.4ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.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 19:39:48 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 574], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.6ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 515 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 516) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 516], ["deliverable_type", "Rooler::Rule"], ["rule_id", 515], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (1.0ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 515]] Rooler::Rule Load (1.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 516]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (23.3ms) Date: Fri, 28 Mar 2014 20:39:48 +0100 From: default@myapp.com To: test@email.com Message-ID: <5335d004cef14_36133fce0d434cdc233bb@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-28 19:39:48.868536' WHERE "rooler_deliveries"."id" = 256 Rooler::Delivery Load (0.7ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 256]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-18"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 575], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 517]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 517 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 345) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 345], ["deliverable_type", "Foo"], ["rule_id", 517], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.902904' WHERE "rooler_rules"."id" = 517  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 345]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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 19:39:48 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 576], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 518 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 346) LIMIT 1 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 19:39:48 UTC +00:00], ["deliverable_id", 346], ["deliverable_type", "Foo"], ["rule_id", 518], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-28 19:39:48.936198' WHERE "rooler_rules"."id" = 518  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 346 [["active", false], ["updated_at", Fri, 28 Mar 2014 19:39:48 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 518]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (346) [["rule_id", 518]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 258]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (22.7ms) SAVEPOINT active_record_1 SQL (85.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", Mon, 31 Mar 2014 14:22:02 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 31 Mar 2014 14:22:02 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:02 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 577], ["updated_at", Mon, 31 Mar 2014 14:22:02 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (12.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 519 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 519) LIMIT 1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["deliverable_id", 519], ["deliverable_type", "Rooler::Rule"], ["rule_id", 519], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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", 519]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (5.8ms) Sent mail to test_name@to.com (89.9ms) Date: Mon, 31 Mar 2014 16:22:03 +0200 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53397a0b425bd_10a543fff8dc34cdc374a@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (1.2ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-1"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 578], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-2"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 579], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 580], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 522]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 522 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 348) LIMIT 1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["deliverable_id", 348], ["deliverable_type", "Foo"], ["rule_id", 522], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.399784' WHERE "rooler_rules"."id" = 522  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 522]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (348)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.407141' WHERE "rooler_rules"."id" = 522  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.6ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 581], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 582], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 583], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 524]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 524 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 351) LIMIT 1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["deliverable_id", 351], ["deliverable_type", "Foo"], ["rule_id", 524], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.9ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.539090' WHERE "rooler_rules"."id" = 524 Foo Load (0.7ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 525]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.0ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 525 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 351) LIMIT 1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["deliverable_id", 351], ["deliverable_type", "Foo"], ["rule_id", 525], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.553293' WHERE "rooler_rules"."id" = 525  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 524]]  (0.5ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 524]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (351)) Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 525]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 525]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 525]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-7"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 584], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 526]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 526 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 353) LIMIT 1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["deliverable_id", 353], ["deliverable_type", "Foo"], ["rule_id", 526], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.598517' WHERE "rooler_rules"."id" = 526  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 526]]  (0.4ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (353))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 526]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (353)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.607152' WHERE "rooler_rules"."id" = 526  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 353 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 526]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (353) [["rule_id", 526]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 263]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 353 [["active", true], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 526]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 526 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 353) LIMIT 1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["deliverable_id", 353], ["deliverable_type", "Foo"], ["rule_id", 526], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:03.639361' WHERE "rooler_rules"."id" = 526  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-8"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:13:03 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 585], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-9"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:11:03 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 586], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 587], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 588], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (8.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())  (0.3ms) ROLLBACK  (0.4ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.5ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 591], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.8ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 591]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 592], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:03 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 592]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 593], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 594], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 533 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 534) LIMIT 1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["deliverable_id", 534], ["deliverable_type", "Rooler::Rule"], ["rule_id", 533], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 533]] Rooler::Rule Load (0.9ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_rules"."id" ASC LIMIT 1 [["id", 534]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (18.6ms) Date: Mon, 31 Mar 2014 16:22:04 +0200 From: default@myapp.com To: test@email.com Message-ID: <53397a0c19d05_10a543fff8dc34cdc37545@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-31 14:22:04.122665' WHERE "rooler_deliveries"."id" = 265 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 265]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 595], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 535]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 535 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 357) LIMIT 1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["deliverable_id", 357], ["deliverable_type", "Foo"], ["rule_id", 535], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:04.151872' WHERE "rooler_rules"."id" = 535  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 357]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 596], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 536 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 358) LIMIT 1 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", Mon, 31 Mar 2014 14:22:04 UTC +00:00], ["deliverable_id", 358], ["deliverable_type", "Foo"], ["rule_id", 536], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:22:04.182064' WHERE "rooler_rules"."id" = 536  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 358 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:22:04 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 536]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (358) [["rule_id", 536]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 267]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.4ms) SAVEPOINT active_record_1 SQL (7.0ms) INSERT INTO "rooler_templates" ("body", "cc", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["body", "body is: {{rule.name}}"], ["cc", "{{rule.name}}@cc.com"], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 597], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (1.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 537 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 537) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 537], ["deliverable_type", "Rooler::Rule"], ["rule_id", 537], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.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", 537]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (3.4ms) Sent mail to test_name@to.com (73.2ms) Date: Mon, 31 Mar 2014 16:39:22 +0200 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53397e1a6a1aa_10f563fd0a5834cd440362@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 598], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 599], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 600], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 540]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 540 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 360) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 360], ["deliverable_type", "Foo"], ["rule_id", 540], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.545413' WHERE "rooler_rules"."id" = 540  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 540]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (360)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.550705' WHERE "rooler_rules"."id" = 540  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-4"], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 601], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.4ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 602], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 603], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 542]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 542 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 363) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 363], ["deliverable_type", "Foo"], ["rule_id", 542], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.606667' WHERE "rooler_rules"."id" = 542 Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 543]]  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 543 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 363) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 363], ["deliverable_type", "Foo"], ["rule_id", 543], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.613827' WHERE "rooler_rules"."id" = 543  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 542]]  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 542]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (363)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 543]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 543]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 543]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 604], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 544]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 544 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 365) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 365], ["deliverable_type", "Foo"], ["rule_id", 544], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.643748' WHERE "rooler_rules"."id" = 544  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 544]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (365))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 544]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (365)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.649099' WHERE "rooler_rules"."id" = 544  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 365 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 544]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (365) [["rule_id", 544]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 272]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 365 [["active", true], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 544]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 544 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 365) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 365], ["deliverable_type", "Foo"], ["rule_id", 544], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.672395' WHERE "rooler_rules"."id" = 544  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.1ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "last_checked_at", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:30:22 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 605], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:28:22 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 606], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 607], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 608], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (1.2ms) 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 611], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 611]] Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 612], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 612]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.3ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 613], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 614], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 551 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 552) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 552], ["deliverable_type", "Rooler::Rule"], ["rule_id", 551], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 551]] 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", 552]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.5ms) Sent mail to test@email.com (16.9ms) Date: Mon, 31 Mar 2014 16:39:22 +0200 From: default@myapp.com To: test@email.com Message-ID: <53397e1adc269_10f563fd0a5834cd44047a@Yonahs-MacBook-Pro.local.mail> Subject: subject-16 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-16 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-31 14:39:22.916501' WHERE "rooler_deliveries"."id" = 274 Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 274]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 615], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 553]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 553 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 369) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 369], ["deliverable_type", "Foo"], ["rule_id", 553], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.939858' WHERE "rooler_rules"."id" = 553  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 369]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 616], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 554]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 554 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 370) LIMIT 1 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", Mon, 31 Mar 2014 14:39:22 UTC +00:00], ["deliverable_id", 370], ["deliverable_type", "Foo"], ["rule_id", 554], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:39:22.963943' WHERE "rooler_rules"."id" = 554  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 370 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:39:22 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 554]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (370) [["rule_id", 554]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 276]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (10.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", Mon, 31 Mar 2014 14:42:50 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 31 Mar 2014 14:42:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:50 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 617], ["updated_at", Mon, 31 Mar 2014 14:42:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (2.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 555 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 555) LIMIT 1 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", Mon, 31 Mar 2014 14:42:50 UTC +00:00], ["deliverable_id", 555], ["deliverable_type", "Rooler::Rule"], ["rule_id", 555], ["updated_at", Mon, 31 Mar 2014 14:42:50 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 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", 555]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (4.6ms) Sent mail to test_name@to.com (28.7ms) Date: Mon, 31 Mar 2014 16:42:51 +0200 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53397eebeb6c_110623fe0d9834ce089ce@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.4ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 618], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 619], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 620], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.6ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 558]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 558 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 372) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 372], ["deliverable_type", "Foo"], ["rule_id", 558], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.152436' WHERE "rooler_rules"."id" = 558  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 558]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (372)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.157388' WHERE "rooler_rules"."id" = 558  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-4"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 621], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 622], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 623], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 560]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 560 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 375) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 375], ["deliverable_type", "Foo"], ["rule_id", 560], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.208987' WHERE "rooler_rules"."id" = 560 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 561]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 561 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 375) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 375], ["deliverable_type", "Foo"], ["rule_id", 561], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.217053' WHERE "rooler_rules"."id" = 561  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 560]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 560]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (375)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 561]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 561]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 561]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 624], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 562 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 377) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 377], ["deliverable_type", "Foo"], ["rule_id", 562], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.250402' WHERE "rooler_rules"."id" = 562  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]]  (0.3ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (377))  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (377)) SQL (0.2ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.257666' WHERE "rooler_rules"."id" = 562  (0.6ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 377 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (377) [["rule_id", 562]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 281]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 377 [["active", true], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 562]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.7ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 562 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 377) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 377], ["deliverable_type", "Foo"], ["rule_id", 562], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.288262' WHERE "rooler_rules"."id" = 562  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.1ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:33:51 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 625], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-9"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:31:51 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 626], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-10"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_rules" ("check_frequency", "created_at", "klass_finder_method", "klass_name", "method_params", "name", "template_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["check_frequency", 600], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 627], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 628], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.1ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.4ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-13"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 631], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.6ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 631]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 632], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 632]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.3ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------- Rooler::TemplateTest: test_returns_nil_if_no_test_object --------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 633], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 633]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 634], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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-18"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 635], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 570 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 571) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 571], ["deliverable_type", "Rooler::Rule"], ["rule_id", 570], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL 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", 570]] 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", 571]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.2ms) Sent mail to test@email.com (12.9ms) Date: Mon, 31 Mar 2014 16:42:51 +0200 From: default@myapp.com To: test@email.com Message-ID: <53397eeb80cba_110623fe0d9834ce0908b@Yonahs-MacBook-Pro.local.mail> Subject: subject-17 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-17 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-31 14:42:51.538861' WHERE "rooler_deliveries"."id" = 283 Rooler::Delivery Load (0.8ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 283]]  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 636], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 572]] Foo Load (0.2ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 572 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 381) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 381], ["deliverable_type", "Foo"], ["rule_id", 572], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.566006' WHERE "rooler_rules"."id" = 572  (0.5ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.5ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.8ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 381]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-20"], ["created_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["name", "template-21"], ["subject", "subject-20"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-20"], ["template_id", 637], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 573]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 573 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 382) LIMIT 1 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", Mon, 31 Mar 2014 14:42:51 UTC +00:00], ["deliverable_id", 382], ["deliverable_type", "Foo"], ["rule_id", 573], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:42:51.600135' WHERE "rooler_rules"."id" = 573  (0.1ms) SAVEPOINT active_record_1 SQL (1.0ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 382 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:42:51 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.4ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 573]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (382) [["rule_id", 573]]  (0.1ms) SAVEPOINT active_record_1 SQL (0.2ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 285]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ---------------------------------------- Rooler::DeliveryMailerTest: test_deliver ----------------------------------------  (0.3ms) SAVEPOINT active_record_1 SQL (10.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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["name", "template-1"], ["subject", "subject is: {{rule.name}}"], ["to", "{{rule.name}}@to.com"], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "test_name"], ["template_id", 638], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.3ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.9ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 574 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 574) LIMIT 1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["deliverable_id", 574], ["deliverable_type", "Rooler::Rule"], ["rule_id", 574], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Template Load (1.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 574]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (5.3ms) Sent mail to test_name@to.com (30.0ms) Date: Mon, 31 Mar 2014 16:43:29 +0200 From: default@myapp.com To: test_name@to.com Cc: test_name@cc.com Message-ID: <53397f11d4aa3_1108e3ff9d1c34cd082755@Yonahs-MacBook-Pro.local.mail> Subject: subject is: test_name Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body is: test_name  (0.3ms) ROLLBACK  (0.2ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_check_all_method_finds_objects_of_rules_class_using_klass_method ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.9ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["name", "template-2"], ["subject", "subject-1"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-1"], ["template_id", 639], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["name", "template-3"], ["subject", "subject-2"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["klass_finder_method", "empty_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-2"], ["template_id", 640], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------ Rooler::RuleTest: test_creates_deliveries_ONCE_for_objects_matching_class_rule ------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-3"], ["created_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["name", "template-4"], ["subject", "subject-3"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-3"], ["template_id", 641], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.7ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 577]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 577 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 384) LIMIT 1 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", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["deliverable_id", 384], ["deliverable_type", "Foo"], ["rule_id", 577], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:29.980591' WHERE "rooler_rules"."id" = 577  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 577]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (384)) SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:29.987653' WHERE "rooler_rules"."id" = 577  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_by_klass_method_finds_objects_of_rules_class_using_klass_method_with_params. --------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:29 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-5"], ["subject", "subject-4"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "take"], ["klass_name", "Foo"], ["method_params", "--- 1\n...\n"], ["name", "rule-4"], ["template_id", 642], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_find_undelivered_by_klass_finds_unprocessed_objects_using_klass_method._works_with_both_AR_relations_and_arrays --------------------------------------------------------------------------------------------------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-5"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-6"], ["subject", "subject-5"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-5"], ["template_id", 643], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-6"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-7"], ["subject", "subject-6"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "array_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-6"], ["template_id", 644], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 579]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 579 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 387) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 387], ["deliverable_type", "Foo"], ["rule_id", 579], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.046107' WHERE "rooler_rules"."id" = 579 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 580]]  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.3ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 580 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 387) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 387], ["deliverable_type", "Foo"], ["rule_id", 580], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.055319' WHERE "rooler_rules"."id" = 580  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 579]]  (0.4ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 579]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') AND ("foos"."id" NOT IN (387)) Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."id" = $1 LIMIT 1 [["id", 580]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t')  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 580]]  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 580]]  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_finds_delivered_objects_where_the_condition_no_longer_applies_and_resets_them ----------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-8"], ["subject", "subject-7"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-7"], ["template_id", 645], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 581]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.5ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 581 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 389) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 389], ["deliverable_type", "Foo"], ["rule_id", 581], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.091262' WHERE "rooler_rules"."id" = 581  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 581]]  (0.5ms) SELECT COUNT(*) FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (389))  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 581]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND ("foos"."id" NOT IN (389)) SQL (0.3ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.099795' WHERE "rooler_rules"."id" = 581  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 389 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 581]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (389) [["rule_id", 581]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 290]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.1ms) SAVEPOINT active_record_1 SQL (0.5ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 389 [["active", true], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 581]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 581 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 389) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 389], ["deliverable_type", "Foo"], ["rule_id", 581], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.129348' WHERE "rooler_rules"."id" = 581  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------------------------------------------------------------------------------------- Rooler::RuleTest: test_scope_ready_to_be_checked_returns_rules_where_last_checked_at_is_<_than_check_frequency.ago_or_nil -------------------------------------------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-9"], ["subject", "subject-8"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:34:30 UTC +00:00], ["method_params", nil], ["name", "rule-8"], ["template_id", 646], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-10"], ["subject", "subject-9"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["last_checked_at", Mon, 31 Mar 2014 14:32:30 UTC +00:00], ["method_params", nil], ["name", "rule-9"], ["template_id", 647], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-11"], ["subject", "subject-10"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-10"], ["template_id", 648], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-11"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-12"], ["subject", "subject-11"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-11"], ["template_id", 649], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 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())  (0.2ms) ROLLBACK  (0.1ms) BEGIN --------------------------------------------------------------------------------------- Rooler::RuleTest: test_won't_let_you_create_a_rule_with_an_invalid_class_or_method_name ---------------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-12"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-13"], ["subject", "subject-12"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (1.0ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-13"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-14"], ["subject", "subject-13"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------------------------- Rooler::TemplateTest: test_finds_an_object_from_one_of_the_templates_rules --------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.8ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-14"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-15"], ["subject", "subject-14"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-14"], ["template_id", 652], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.7ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 652]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 SQL (0.4ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------------------------------------------------- Rooler::TemplateTest: test_returns_a_tree_of_liquid_methods_from_the_sample_object ----------------------------------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-16"], ["subject", "subject-15"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-15"], ["template_id", 653], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.5ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 653]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.2ms) ROLLBACK  (0.2ms) BEGIN -------------------------------------------------------- Rooler::TemplateTest: test_returns_nil_if_no_test_object --------------------------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-17"], ["subject", "subject-16"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-16"], ["template_id", 654], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1 Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules" WHERE "rooler_rules"."template_id" = $1 [["template_id", 654]] Foo Load (0.3ms) SELECT "foos".* FROM "foos" WHERE ('t') ORDER BY "foos"."id" ASC LIMIT 1  (0.1ms) ROLLBACK  (0.1ms) BEGIN ---------------------------------------- RoolerTest: test_delivers_pending_emails ----------------------------------------  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-18"], ["subject", "subject-17"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-17"], ["template_id", 655], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-18"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-19"], ["subject", "subject-18"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-18"], ["template_id", 656], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 589 AND "rooler_deliveries"."deliverable_type" = 'Rooler::Rule' AND "rooler_deliveries"."deliverable_id" = 590) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 590], ["deliverable_type", "Rooler::Rule"], ["rule_id", 589], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 Rooler::Delivery Load (0.3ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."delivered_at" IS NULL Rooler::Template Load (0.8ms) SELECT "rooler_templates".* FROM "rooler_templates" INNER JOIN "rooler_rules" ON "rooler_templates"."id" = "rooler_rules"."template_id" WHERE "rooler_rules"."id" = $1 ORDER BY "rooler_templates"."id" ASC LIMIT 1 [["id", 589]] 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", 590]] Rendered /Users/yonah/Development/spree/rooler/app/views/rooler/delivery_mailer/send_mail.html.erb (0.3ms) Sent mail to test@email.com (16.2ms) Date: Mon, 31 Mar 2014 16:43:30 +0200 From: default@myapp.com To: test@email.com Message-ID: <53397f1260310_1108e3ff9d1c34cd082881@Yonahs-MacBook-Pro.local.mail> Subject: subject-17 Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit body-17 SQL (0.4ms) UPDATE "rooler_deliveries" SET "delivered_at" = '2014-03-31 14:43:30.408554' WHERE "rooler_deliveries"."id" = 292 Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 LIMIT 1 [["id", 292]]  (0.2ms) ROLLBACK  (0.2ms) BEGIN ------------------------------------------ RoolerTest: test_processes_scheduled_rules ------------------------------------------  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) INSERT INTO "foos" ("created_at", "updated_at") VALUES ($1, $2) RETURNING "id" [["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "rooler_templates" ("body", "created_at", "name", "subject", "to", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["body", "body-19"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-20"], ["subject", "subject-19"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_record_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-19"], ["template_id", 657], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.4ms) SELECT COUNT(*) FROM "rooler_deliveries" 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())  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 591]] Foo Load (0.5ms) SELECT "foos".* FROM "foos" WHERE ('t') AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 591 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 393) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 393], ["deliverable_type", "Foo"], ["rule_id", 591], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.443203' WHERE "rooler_rules"."id" = 591  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Delivery Load (0.4ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" ORDER BY "rooler_deliveries"."id" DESC LIMIT 1 Foo Load (0.6ms) SELECT "foos".* FROM "foos" WHERE "foos"."id" = $1 ORDER BY "foos"."id" ASC LIMIT 1 [["id", 393]]  (0.2ms) ROLLBACK  (0.1ms) BEGIN -------------------------------------------- RoolerTest: test_resets_resetable_deliveries --------------------------------------------  (0.1ms) SAVEPOINT active_record_1 SQL (0.7ms) INSERT INTO "foos" ("active", "created_at", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["active", true], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.2ms) SAVEPOINT active_record_1 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-20"], ["created_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["name", "template-21"], ["subject", "subject-20"], ["to", "test@email.com"], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.1ms) SAVEPOINT active_record_1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["klass_finder_method", "active_finder"], ["klass_name", "Foo"], ["method_params", nil], ["name", "rule-20"], ["template_id", 658], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 592]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' AND (1=1)  (0.2ms) SAVEPOINT active_record_1 Rooler::Delivery Exists (0.4ms) SELECT 1 AS one FROM "rooler_deliveries" WHERE ("rooler_deliveries"."rule_id" = 592 AND "rooler_deliveries"."deliverable_type" = 'Foo' AND "rooler_deliveries"."deliverable_id" = 394) LIMIT 1 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", Mon, 31 Mar 2014 14:43:30 UTC +00:00], ["deliverable_id", 394], ["deliverable_type", "Foo"], ["rule_id", 592], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.2ms) RELEASE SAVEPOINT active_record_1 SQL (0.4ms) UPDATE "rooler_rules" SET "last_checked_at" = '2014-03-31 14:43:30.476204' WHERE "rooler_rules"."id" = 592  (0.2ms) SAVEPOINT active_record_1 SQL (0.6ms) UPDATE "foos" SET "active" = $1, "updated_at" = $2 WHERE "foos"."id" = 394 [["active", false], ["updated_at", Mon, 31 Mar 2014 14:43:30 UTC +00:00]]  (0.1ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries" Rooler::Rule Load (0.3ms) SELECT "rooler_rules".* FROM "rooler_rules"  (0.3ms) SELECT "rooler_deliveries"."deliverable_id" FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 [["rule_id", 592]] Foo Load (0.4ms) SELECT "foos".* FROM "foos" WHERE "foos"."active" = 't' Rooler::Delivery Load (0.6ms) SELECT "rooler_deliveries".* FROM "rooler_deliveries" WHERE "rooler_deliveries"."rule_id" = $1 AND "rooler_deliveries"."deliverable_id" IN (394) [["rule_id", 592]]  (0.2ms) SAVEPOINT active_record_1 SQL (0.3ms) DELETE FROM "rooler_deliveries" WHERE "rooler_deliveries"."id" = $1 [["id", 294]]  (0.2ms) RELEASE SAVEPOINT active_record_1  (0.3ms) SELECT COUNT(*) FROM "rooler_deliveries"  (0.3ms) ROLLBACK